in reply to Integer detection concept
How do I determine whether a scalar is a number/whole/integer/float?Assuming that you don't care about IEEE notations like "NaN" or "Infinity", you probably just want to use a regular expression.
... if (/^-?\d+$/) { print "is an integer\n" } if (/^[+-]?\d+$/) { print "is a +/- integer\n" } ...
|
|---|