in reply to Validating numeric input
Now of course that maps input like "asdf" to the integer zero so you still need to check the input like you are doing. There are some related comments in the perlfaq at How do I determine whether a scalar is a number/whole/integer/float?my $line = <>; chomp $line; my $num = int $line;
|
|---|