On Fri, 22 Feb 2002, Roger Burton West wrote: > On Fri, Feb 22, 2002 at 02:50:39PM +0000, Mark Fowler wrote: > > > - Optionally use name value pair. This is very very messy but might > > be my best option. Look out though, has can take 5,6,7 or 8 > > arguments depending if you've got a comment and colour indexes or not. > > Yes. That's what I'd do. Rely on the first argument's numeric-ness to > determine whether it's a parameter list or name-value. Then run one of > the two distinct parameter-parsing routines, which bung everything into > a convenient hash for the rest of the function to play with...
What's the best way to go about working out numeric-ness - Check for digits/undef in the string with a regex - this *so* doesn't work with objects that use overloading to provide numeric value and something different for stringification - ditto for Scalar::Util's dualval (so I can't just check for blessedness) - See if it matches any of our option keys? Oooh, expensive. > Then again, I don't do objects, so there may be cleaner ways of doing > that. I had a think about this and I did think that I could indeed do $tester->use_widths; $tester->use_coords Or something like that. But then this is a major pain if you have lots of tester objects (you need one for each image you test) Alternativly I could set a global $Test::GD::args = "widths" or even have use_widths and use_coords set that global. Arrgh, too many options. None of them clear -- s'' Mark Fowler London.pm Bath.pm http://www.twoshortplanks.com/ [EMAIL PROTECTED] ';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/ +/ ){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}