in reply to substitution question
On the other hand, if you don't like eval:my $SUBS='s/AA/BB/g'; $STR = "AAXXXAA"; eval "\$STR =~ $SUBS;"; print $STR, "\n";
my $lh_sub = "AA"; my $rh_sub = "BB"; $STR = "AAXXXAA"; $STR =~ s/$lh_sub/$rh_sub/g; print $STR, "\n";
|
|---|