in reply to Re^2: Substitution backreference woes
in thread Substitution backreference woes
my $string = 'Hello sailor'; my $regex = 'Hello (.*)'; my $substitution = '"Goodbye $1"'; $string =~ s/$regex/$substitution/ee; print "string is now <$string> \n";
/usr/bin/perl -w /tmp/regex.pl string is now <Goodbye sailor>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Substitution backreference woes
by Anonymous Monk on Jan 24, 2015 at 13:59 UTC |