John McNamara <[EMAIL PROTECTED]> writes: > As far as I can see the current consensus is as follows: > 1. Implicit variable: nice but not really worth the trouble. > 2. Explicit variable between foreach and the array: might conflict > with other proposals. > 3. Explicit counter in the body of the for/each loop: a clean > solution but requires a new or reused function. What happened to the --nice, elegant and sparse array friendly-- extension of each/keys/values? for ( ($i,$v) = each(@a) ) { print "Value $v at index $i\n"; } foreach ( keys @a ) { print "Value $a[$_] at index $_\n"; } -- Johan
- Re: RFC 120 (v2) Implicit counter in for stat... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit counter in for ... John McNamara
- Re: RFC 120 (v2) Implicit counter in for stat... Steve Simmons
- Re: RFC 120 (v2) Implicit counter in for stat... David L. Nicol
- Re: RFC 120 (v2) Implicit counter in for ... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit counter in ... Tom Christiansen
- Re: RFC 120 (v2) Implicit counte... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit co... Tom Christiansen
- Re: RFC 120 (v2) Implicit counter in ... Chaim Frenkel
- Re: RFC 120 (v2) Implicit counte... David L. Nicol
- Re: RFC 120 (v2) Implicit counter in for stat... Johan Vromans
- Re: RFC 120 (v2) Implicit counter in for ... Tom Christiansen
- Re: RFC 120 (v2) Implicit counter in for statements, p... John McNamara