ramble
asked on
Is it a real number?
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
perldoc -q "How do I determine whether a scalar is a number/whole/integer/float ?"
ASKER
Thanks_ramble
Just Ignore the last comment
Just Ignore the last comment