in which $pattern could contain characters with special regexp meanings is there a way to make this work "sensibly" without using one or more previous regexps to escape all the special characters (ie in this case convert $pattern to '\$ signs').my $string = 'Some text with $ signs in it'; my $pattern = '$ signs'; $string =~ s/$pattern/dollar signs/; print "$string\n"
In reply to Quoting strings in regexps by Bilbo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |