Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Looping Over Hash Skips an Element?

by toolic (Chancellor)
on Jan 06, 2012 at 18:29 UTC ( #946642=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Looping Over Hash Skips an Element?
in thread Looping Over Hash Skips an Element?

How about:

use List::MoreUtils qw(natatime); use List::Util qw(sum); use Data::Dumper; my @sums; my $it = natatime(8, (values %ifSpeeds)); while (my @vals = $it->()) { push @sums, sum(@vals); } print Dumper(\@sums); __END__ $VAR1 = [ '6200000000', '6200000000', '6200000000', '2600000000' ];


Comment on Re^3: Looping Over Hash Skips an Element?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2015-01-31 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (259 votes), past polls