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
- Re: RFC 120 (v1) Implicit counter in C<for... Tim Jenness
