my $replace = '"$2ead"'; $s1 =~ s/$pattern/++$k && $replace/gee;
Note the two /e modifiers and the extra double quotes in $replace. The first eval will change the replacement to "$2ead" and the second eval does the double quote interpolation correctly.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: defering substitution within double-quoted strings?
by sauoq
in thread defering substitution within double-quoted strings?
by SeekerOKnowledge
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |