in reply to How do i find $a and replace it with $b when it's preceded by $c?
A postivive look behind clause in the regular expression will do what you want.
produces moobaryou in $dmy($a, $b, $c, $d) = qw{foo bar moo moofooyou); $d =~ s/(?<=$c)$a/$b/g;
|
---|
In Section
Seekers of Perl Wisdom