in reply to Question on pattern matching

If the string is only two digits, you can use faster check with hash keys existence:
my %digits = map{ '0'x(2-length($_)).$_, 1 }0..99; #now keys in %digits are from 00,01 ... to 99 if( exists $digits{$my_dat} ){ ... }