in reply to defering substitution within double-quoted strings?
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.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: defering substitution within double-quoted strings?
by SeekerOKnowledge (Initiate) on Sep 04, 2003 at 20:53 UTC |