you need to quote it either using \Q ... \E or quotemeta:
my $jim = "jim("; my $string = "A string with jim( in it"; print "yeah" if $string =~ m/\Q$jim\E/; #or $jim = quotemeta $jim; print "yeah" if $string =~ m/$jim/;
In reply to Re: match ( ?
by FunkyMonk
in thread match ( ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |