I like Perl 6's mechanism:
for @array.kv -> $i, $v { print "Item at index $i has value $v\n"; }
If only there were a way to incorporate it into Perl 5. Maybe I should add that to the wish list for perl 5.12
In reply to Re: Automatic Loop Counter not in perl
by duff
in thread Automatic Loop Counter not in perl
by b4swine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |