- or download this
...
my $replace = '"$1 Perl"';
$text2 =~ s/$match/$replace/ee;
- or download this
my $replace = '$1 Perl'; # use original setting of $replace
$text2 =~ s/$match/'"'.$replace.'"'/ee;
- or download this
my $replace = sub { "$1 Perl" };
$text2 =~ s/$match/$replace->()/e;