Apart from the stuff you tried there is also another hack which uses the experimental (?{...}) code assertions:
our @matches; m/(?>(something)(?{ push @matches, $^N }))/;
In reply to Re: Getting a list of captures in Perl 5.10
by moritz
in thread Getting a list of captures in Perl 5.10
by amir_e_a
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |