in reply to Automatic Loop Counter not in perl
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Automatic Loop Counter not in perl
by moritz (Cardinal) on Aug 22, 2007 at 08:33 UTC | |
|
Re^2: Automatic Loop Counter not in perl
by princepawn (Parson) on Aug 21, 2007 at 17:19 UTC |