in reply to need idiom - compare a number to a string

Warnings are jsut warnings. Once you've seen it and decide that it's not a problem, you can turn it off for a bit.

{ # local $^W = 0; # old way no warnings; $value = ( int($value) == $value ) ? $value : lookupString( $value ); }

However, if you're using constants in the code, strings are much better (if they are descriptive). Don't take a step backwards by making everything a magic number. :)

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review