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};
};