in reply to Generate a # between 1 and 50 in groups of 5

Here's yet another way. The difference is that it will avoid duplicates of a given number in your "groups of 5."

use List::Util 'shuffle'; my @shuffled = shuffle ( 1 .. 50 ); print join ' ', splice( @shuffled, 0, 5 ), "\n" for 1 .. 5;