in reply to How to identify a number datatype in a string?
if (($m == 0) && !($m eq '0')) {print "string\n";} else {print "number +\n";}
It works since PERL treats strings as 0 in numeric tests. (It also pulls numbers out of strings if the numbers come first)
Edited by davido: Added code tags. Reformatted.
|
|---|