in reply to Validating numeric input

If you are using values entered from <STDIN> don't forget to chomp($value) the value. This will remove a newline character (if it exists). A newline character at the end of $value in your example would cause it to fail the regex as well as the above noted problems.

Replies are listed 'Best First'.
Re^2: Validating numeric input
by Fletch (Bishop) on Feb 05, 2005 at 16:54 UTC
    lemur:~ 731> perl -le '$_ = "1234\n"; print "You sure?" if /^\d+$/' You sure? lemur:~ 732>