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;
In reply to Re: Validating numeric input
by superfrink
in thread Validating numeric input
by Kaire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |