use Scalar::Util qw(looks_like_number); if (looks_like_number($foo)) { print "It could be a number.\n"; } else { print "It's just a string.\n"; }
Other solutions could involve regexes from Regexp::Common or coded by hand.
-sam
In reply to Re: Checking for data types
by samtregar
in thread Checking for data types
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |