in reply to Checking for single digit
if ($input =~ m/^\d$/) { ... }
or
if ($input =~ m/^[0-9]$/) { ... }
It's a good idea also to chomp your input before comparison.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Checking for single digit
by Anonymous Monk on May 06, 2003 at 01:24 UTC |