in reply to Keeping a Count in foreach


There isn't an implicit counter in for loops, although people often think that there might be or should be. As such, I proposed this as a possible feature for Perl 6:

RFC 120: Implicit counter in for statements, possibly $#.

The proposal was rejected in Apocalypse 4 but I wouldn't say that I was disappointed. :-)

--
John.