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
In reply to Re: What's missing in Perl 5.10
by grinder
in thread What's missing in Perl 5.10
by Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |