On Wed, Aug 16, 2000 at 11:42:20AM -1000, Tim Jenness wrote: > What about: > > for (0..$#array) { > print $array[$i], " is at index ", $i, "\n"; > } > > I use that whenever I need to loop over indices of two arrays at once. And with the proposed zip() you may be able to do something like for my($val,$i) (zip(@array,0..$#array)) { } Graham.
- RFC 120 (v1) Implicit counter in C<for> statemen... Perl6 RFC Librarian
- Re: RFC 120 (v1) Implicit counter in C<for>... Tim Jenness
- Re: RFC 120 (v1) Implicit counter in C<for... Graham Barr
- Re: RFC 120 (v1) Implicit counter in C<for>... John McNamara
- McNamara's C<$#> as a property of any a... David L. Nicol
- Re: McNamara's C<$#> as a property ... Mike Pastore
- Re: McNamara's C<$#> as a prope... David L. Nicol
- Re: McNamara's C<$#> as a ... Jarkko Hietaniemi
- Re: McNamara's C<$#> a... David L. Nicol
- Re: McNamara's C<$#> as a property ... Hildo Biersma
- Re: McNamara's C<$#> as a property ... Peter Haworth
- Re: McNamara's C<$#> as a property ... David L. Nicol
- Re: RFC 120 (v1) Implicit counter in C<for... Tim Jenness