If you want to kill two birds with one stone, you can verify length and digitness in one statement:if $str =~ /\D/ { print "non-digit" }
if $str !~ /^\d\d$/ { print "wrong length or contains non-digits" }
Cheers - L~R
In reply to Re: Question on pattern matching
by Limbic~Region
in thread Question on pattern matching
by Joe_Cullity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |