my $rxPattern; { local $" = q{|}; $rxPattern = qr{(?x) (@{ [ map { quotemeta } keys %map ] }) }; } $string =~ s{$rxPattern}{$map{$1}}g;
I'd be interested to know if this is a sensible approach.
Cheers,
JohnGG
In reply to Re^3: ugly code
by johngg
in thread ugly code
by fubber
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |