Keep It Simple, Stupid | |
PerlMonks |
Re (tilly) 1: Checking whether a $var is a numberby tilly (Archbishop) |
on Sep 06, 2001 at 00:22 UTC ( [id://110412]=note: print w/replies, xml ) | Need Help?? |
One issue that nobody has yet mentioned is the possibility of having objects that work as numbers thanks to overload. I guarantee that all of the regex solutions will fail miserably on this because they coerce to a string, not a number. These may be (as in the case of $!) radically different things... Without a hook to the internal API, the only real solution is to try to use it as a number and see if Perl complains.
In Section
Seekers of Perl Wisdom
|
|