Where the key in %table is the thing to replace and the value is what to replace it with.$string =~ s/$_/$table{$_}/g for keys %table;
Cheers - L~R
Update: It looks like Enlil and I had about the same idea. The difference is his regex only runs once while mine runs as many times as there are keys in hash. I know that alternation really slows down a regex, but his method is still probably faster overall though you could benchmark it if you wanted to know for sure.
In reply to Re: multi find/replace
by Limbic~Region
in thread multi find/replace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |