in reply to Improve processing time for string substitutions
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Improve processing time for string substitutions
by Anno (Deacon) on Apr 16, 2007 at 15:46 UTC | |
by ikegami (Patriarch) on Apr 16, 2007 at 15:56 UTC | |
by Corion (Patriarch) on Apr 16, 2007 at 15:56 UTC | |
by Anno (Deacon) on Apr 16, 2007 at 16:06 UTC |