OK, good to know. My brain seems to have lost all knowledge of the 'e' modifier. Tried to get it to work with this simple example:
my $new = 'blah';
my $string = 'asdfjkjl';
my $find = '(asd)';
my $replace = '$1' . $new;
replace ($string, $find, $replace);
sub replace {
my $string = shift;
my $left = shift;
my $replace = shift;
$string =~ s/$left/$replace/e;
print $string;
}
Still prints $1 in the output though. Adding 'ee' throws an error: "Bareword found where operator expected at (eval 1) line 1, near "$1blah"