Is this considered the right way to go about it? Is there a better way?use warnings; use strict; my $var = 'abc'; no warnings; my $testvar = $var + 0; use warnings; if ($var eq $testvar) { print "$var is numeric\n"; } else { print "oops, $var is NOT numeric\n"; }
In reply to How to determine if something is numeric? by mifflin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |