Like I already told you in the CB:
my $re = join "|", map { quotemeta $_ } keys %entitylist; $re = qr/(?:$re)/; # ... $string =~ s/($re)/$entitylist{ $1 }/ge;
You might want to take a look at perlre for the /e switch.
In reply to Re: Improve processing time for string substitutions
by Corion
in thread Improve processing time for string substitutions
by valavanp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |