in reply to getting iteration number inside iteration loop
Yes, this has been discussed ad nauseam and no, there's not such a variable. Hence one should either maintain a counter like you did or, when the actual list happens to be an array as in your example, despite the appeal of iterating over an @array with aliasing to its elements, just iterate over 0..$#array and use subscripting.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: getting iteration number inside iteration loop
by jesuashok (Curate) on Jun 29, 2007 at 08:12 UTC |