$str = "42xxx"; if ( $str == 42 ) { print "BINGO !\n"; }