in reply to Re: Re: Getting the number of times a regexp matches
in thread Getting the number of times a regexp matches

I suspect it has something to do with the way these things do work:
($a, $b, $c) = (1, 2, 3); ($a, $b) = (1, 2, 3); # 3 discarded ($a, undef, $c) = (1, 2, 3); # 2 discarded ($a, undef) = (1, 2, 3); # 2 and 3 discarded (undef, undef, undef) = (1, 2, 3); # 1 2 and 3 discarded () = (1, 2, 3); # functionally equivalent
"undef" is the only real non-variable value you can use on the left-hand-side like that.