in reply to Checking for single digit
if ($input =~ /^[0-9]$/) { print "input was a single digit number\n"; } else { print "input wasn't a single digit number\n"; }
Unless they are used, Perl will look for a match anywhere within your $input string! ;-)^ Match the beginning of the line $ Match the end of the line (or before newline at the end)
# Under Construction
|
---|