in reply to hashes in regexes
$keys = join '|', map "\Q$_\E", keys %sub_hash; $keys_REx = qr/$keys/; $string =~ s/($keys_REx)/$sub_hash{$1}/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hashes in regexes
by tadman (Prior) on Mar 29, 2001 at 04:12 UTC |