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


in reply to Weirdness (duplicated data) while building result during parsing using regex

If you add an 'use Data::Dump' to your module and insert lines like
print "4 \$_: '$_'\n", "\$^N: ", dd( $^N ), "\$^R: ", dd( $^R );
after your 'push' instructions, there is clearly a difference in behavior between your example cases.

Maybe you can figure it out from there?