my $matcher = do { local $" = q{|}; qr{(?=(@pairs))}; }; #### $ perl -e ' > @arr = qw{a b c}; > print qq{"@arr"\n};' "a b c" $