in reply to What's missing in Perl 5.10
What is missing is the ability to use each on an array. It would work like this:
my @array = qw( foo bar rat ); while (my ($val,$idx) = each @array) { say "$val at $idx"; } # produces foo at 0 bar at 1 rat at 2
Sometimes it's really nice to have both the value and index at once. Nicholas Clark had this up and running in bleadperl a few months ago, but the pumpking judged that it was regretfully a far too major change in the syntax to hold up the release of 5.10
There is discussion about how to retro-future-fit it into the 5.10 maintenance track, so as to avoid a full release cycle that would require waiting for the first 5.12 release.
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What's missing in Perl 5.10
by Roy Johnson (Monsignor) on Dec 20, 2007 at 21:33 UTC | |
|
Re^2: What's missing in Perl 5.10
by blazar (Canon) on Dec 20, 2007 at 16:34 UTC | |
|
Re^2: What's missing in Perl 5.10
by moritz (Cardinal) on Dec 21, 2007 at 08:16 UTC |