I'm looking for a number somewhere between -10000 and 10000.
if (($_ < -9999) || ($_ >9999)) {
print "\nIt's a number, but out of range\n";
} elsif ($_ >-10000) && ($_ <10000) {
print "\nPerfect\n";
} elsif ($_ is an alpha/number or just contains alpha) {
print"\nNumber expected, this contains other characters\n";
} else {print "\nShouldn't get here\n";}
I specifically need to know how to determine if $_ is a number or not.
$var='abc';
print "$var is not a number\n" unless ($var =~ /\d+$/);