in reply to How to identify a number datatype in a string?

Identify String or number: Ben Young;
I tried this and it only fails on $x = '0.0', but not $x = 0.0

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.