# numeric -- returns true if arg. is numeric sub numeric { my $value = shift; my $result = 1; local $^W = 1; # turn warnings on if they aren't already. local $SIG{__WARN__} = sub { $result = 0 }; # if we get a warning make $result false $value += 0; return $result; }
In reply to Re: Checking whether a $var is a number
by wog
in thread Checking whether a $var is a number
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |