With my $substitution = 'Goodbye \1'; which is obviously not a regex, which regex "group" are you back-referring to?
Check this however:
my $string = "Hello sailor"; my $regex = qr/Hello (.*)/; $string =~ s/$regex/Goodbye \1/; print "string is now $string \n";
In reply to Re: Substitution backreference woes
by 2teez
in thread Substitution backreference woes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |