if ($text =~ /^[+-]\d+\.\d*$/) {print "It's a number.";}
$text = "-3.1415"; if ($text =~ /^[+-]\d+\.\d*$/) {print "It's a number.";}