"test" =~ /t/; # successful match my $var = ""; print "matched 't'\n" if "t" =~ /\Q$var\E/; print "matched 'u'\n" if "u" =~ /\Q$var\E/;