in reply to substitution interpolation?
I don't know if you have the liberty of reformulating the contents of $sub, but if instead of '$1 spooge' maybe you can use '$1.q{ spooge}' and from there you can employ the /ee switch and gain major Perl purity points!
my $var = "my dog spot"; my $expr = "(my (dog|cat)) spot"; my $sub = '$1.q{ spooge}'; $var =~ s/$expr/$sub/ee; print $var;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: substitution interpolation?
by larryk (Friar) on May 31, 2001 at 14:39 UTC |