in reply to Re: Using a regex capture as part of a varible
in thread Using a regex capture as part of a varible
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"
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In Section
Seekers of Perl Wisdom