if $str !~ /^\d\d$/ { print "wrong length or contains non-digits" }