in reply to Re: Multiple substitute values
in thread Multiple substitute values
Are %repl's keys regexp or text?
If they're regexp, your lookup won't work.
If they're text, they should be converted to regexps before being included in the combined regexp.
my $search = join "|", map { qr-\b\Q$_\E\b- } keys %repl;
Of course, you're better of using Regexp::List.
use Regexp::List; my $search = Regexp::List->new->list2re(keys %repl);
|
|---|