You can use regexes to validate user input:
if ($input =~ /^[0-9]+$/) { # work with $input here } else { die "Please enter an integer\n"; }
See also: Scalar::Util::looks_like_number
In reply to Re: catching incorrect input type
by moritz
in thread catching incorrect input type
by brayk1990
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |