OK, I've seen this go by (incorrectly) in the CB twice in a week, so I'm going to post a note on it so I can refer to it again and again.
After this code:
my @x = "abcdefgh" =~ /(.)(.)/g;
the size of @+ is three elements, since it records
only the most recent complete regex match, with ending
position info for $&, $1, $2 (3 elements total). The values are (8, 7, 8).
The size of @x is indeed eight elements: the cumulative
total of how many different memories matched for all
matches (four matches, two apiece).
There. Let's please have no more advice in the CB
that the way to get the "number of matches" is to look at @+. Thank you.
-- Randal L. Schwartz, Perl hacker