http://qs321.pair.com?node_id=255780


in reply to Checking for single digit

In your match try to use the special regexp anchors ^ and $:
if ($input =~ /^[0-9]$/) { print "input was a single digit number\n"; } else { print "input wasn't a single digit number\n"; }

From the Perl regular expression tutorial (perlre), the "^" and "$" are defined as:
^ Match the beginning of the line $ Match the end of the line (or before newline at the end)
Unless they are used, Perl will look for a match anywhere within your $input string! ;-)

Update: threw in some perldoc definitions for your viewing pleasure :)

_____________________
# Under Construction