This is also a FAQ: perldoc -q number
use warnings; use strict; use Scalar::Util qw(looks_like_number); my $s = shift; if (looks_like_number($s)) { print "$s is a number\n"; } else { print "$s isn't a number\n"; }
In reply to Re: A function to determine if a string is numeric
by toolic
in thread A function to determine if a string is numeric
by juliosergio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |