http://qs321.pair.com?node_id=681825


in reply to force regular expression to match every item only once

I'm not exactly sure what you want to achieve, but from what I read I would think you want matching pairs in $matcher instead of zero-length assertions, as in:

my $matcher = qr/(?:(@{[join "|", @pairs]}))/;

Which gives 3 matches instead of 5 (likewise for $dictword = "zeezze";.)

If I' completely wrong, please clean the syntax/stricture errors in your OP first.