in reply to Re: Multiple substitute values
in thread Multiple substitute values

I don't know if it's better or not but I would try to incorporate the capturing parentheses in the generated pattern rather than having to remember to put them in the substitution later.

my $search = do { local $" = q{|}; qr{\b(@{ [ keys %repl ] })\b}; };

It just seems safer to keep everything together.

Cheers,

JohnGG