use strict; use warnings; use List::Util qw(sum shuffle); use List::MoreUtils qw(natatime); use feature qw(say); my $iterator = natatime 5, shuffle( 1 .. 50 ); my $count = 1; while ( my @five = $iterator->() ) { say sum(@five); $count++; last if $count > 5; }
See also:
In reply to Re: Sum group of numbers and display each number is on its own line
by toolic
in thread Dice roll chances
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |