in reply to Looping Over Hash Skips an Element?
If you want the 9th to show up in your output, you need to print it:
Update: List::MoreUtils can also be used for this:foreach my $key ( keys %ifSpeeds ) { if ($counter <= 8) { print "$key "; $counter++; } else { print "$key\n"; # <-------------- $counter = 1; } }
use List::MoreUtils qw(natatime); my $it = natatime(9, (keys %ifSpeeds)); while (my @vals = $it->()) { print "@vals\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Looping Over Hash Skips an Element?
by mmartin (Monk) on Jan 06, 2012 at 18:11 UTC | |
by toolic (Bishop) on Jan 06, 2012 at 18:29 UTC | |
by Eliya (Vicar) on Jan 06, 2012 at 18:42 UTC |
In Section
Seekers of Perl Wisdom