You want to produce the codeOr how to embed " in the output - but that's not a biggie right now.
so"$1 \"Perl\""
my $replace = '"$1 \\"Perl\\""'; # Produces: "$1 \"Perl\"" s/$match/eval $replace/e
Technically, the slashes don't need to be doubled since single quotes are forgiving when it's unambiguous.
In reply to Re^3: Regular expression "replace string interpolation" problem
by ikegami
in thread Regular expression "replace string interpolation" problem
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |