if(($totalNumber =~ /^\d{2}$/){ if($totalNumber <= 10){ print "the number is less than 10\n"; } }