Note the double quotes in $replace and the /ee on the s///. The first e causes $replace to be evaluated, which returns "${1}bar" which is then evaluated by the second e which returns foobar.$string = 'string with word foo in it'; $find = '(foo)'; $replace = '"${1}bar"'; $string =~ s/$find/$replace/eeg;
In reply to Re: Regex prob with interpolated patterns
by Paladin
in thread Regex prob with interpolated patterns
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |