in reply to Re^3: Normal regexes stop working
in thread Normal regexes stop working

#!perl -w use strict; my $test = 'foo[bar]'; my $test2 = $test; print $test eq $test2 ? "'$test' is equal to itself\n" : "'$test' is n +ot equal to itself\n"; print $test =~ /$test2/ ? "'$test' does match itself\n" : "'$test' doe +s not match itself\n"; __END__ > perl -w tmp.pl 'foo[bar]' is equal to itself 'foo[bar]' does not match itself

Also see quotemeta and/or \Q..\E.