in reply to Re: I don't understand.
in thread Detecting if a scalar has a number or string

Ok, here's a bit of enhancement:
foreach $abc ("asd","","0","123","-12","1.2","-1.2","12-","-a12","a1") {print "$abc:", is_a_num($abc) ? "Number" : "NaN", "\n";} sub is_a_num { return ($_[0] =~ /^(\+|-)?([0-9]|\.)+$/) || 0 ; }
Thierry