in reply to Checking whether a value is numeric or not
Regexp::Common might keep you from reinventing the wheel:
use Regexp::Common; while (<DATA>) { chomp; /^$RE{num}{real}$/ and print "$_ is a number\n"; } __DATA__ 123 abc 0.123 [download]