in reply to Running count in map

map doesn't maintain state, just like grep doesn't. They operate on lists, not items in the list.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re^2: Running count in map
by Fletch (Bishop) on Aug 06, 2004 at 18:35 UTC

    Of course $_ is an alias for the original items in the list so you can use it to modify the original items if you want.</pedant> (not that that answers the original is-there-an-index question)