Among other reasons:
sub is_a_num { $_[0] =~ m/^[0-9]*$/ } my $not_at_all = ''; print is_a_num( $not_at_all ) ? "Yeppers.\n" : "Nopers.\n";
Beware the Star of Regex!
In reply to Re: I don't understand.
by Your Mother
in thread Detecting if a scalar has a number or string
by rrwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |