if ($input =~ m/^\d$/) { ... }
or
if ($input =~ m/^[0-9]$/) { ... }
It's a good idea also to chomp your input before comparison.
In reply to Re: Checking for single digit
by TVSET
in thread Checking for single digit
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |