Another option is to build a regular expression like this:
where "foo", "bar", and "baz" are your constants, the keys in your %constants hash. You'll want to use \Q and \E around each of the constants if they contain any regexp metacharacters.s/(foo|bar|baz)/$constants{$1}/g;
In reply to Re: How do I speed this up?
by btrott
in thread How do I speed this up?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |