in reply to Regular expression "replace string interpolation" problem
This should work:
Or you might want to write it like this:... my $replace = '"$1 Perl"'; $text2 =~ s/$match/$replace/ee;
Probably even a better solution would be write $replace as a subroutine:my $replace = '$1 Perl'; # use original setting of $replace $text2 =~ s/$match/'"'.$replace.'"'/ee;
and then only level of evaluation is needed.my $replace = sub { "$1 Perl" }; $text2 =~ s/$match/$replace->()/e;
In Section
Seekers of Perl Wisdom