if( $str1 =~ /^\Q$str2\E/ ) { print "match\n"; } else { print "nomatch\n"; }