There are a gazillion variables "free" to choice from, unless you insist on one-character punctuation variables. Frankly, I don't think you need a one-character punctuation variable for this, and
%{^MATCH_OFFSETS}
will do fine. Personally, I'd like the values being arrays of arrays, the inner arrays 2 elements, the index of the start of the match, and the index just after the end of the match. (that is, similar to @- and @+). The outer array will hold as many captures with that name there are, so if you have:
"abc" =~ /(?<l>[a-z])(?<l>[a-z])(?<l>[a-z])/
the result is:
%{^MATCH_OFFSETS} = ('l' => [[0, 1], [1, 2], [2. 3]]);
I'm also pretty sure that if someone write a patch, it will be added to Perl. | [reply] [d/l] [select] |
I personally believe it's clear enough that I don't insist but would certainly like... one-character punctuation variables which are nice, too! ;) I fully second the rest of your suggestion, BTW.
If %- were not taken, I would have expected it to hold that kind of info. Methods would be the best thing though... I'm playing more and more with autobox but I know it doesn't fit too well in Perl 5's like typical mindset. (Apart the fact that its very docs warn about it not being real autoboxing!) And I don't know how would it square playing with such special variables as the ones we're discussing here...
| [reply] [d/l] [select] |