in reply to Generate a # between 1 and 50 in groups of 5
#! /usr/bin/perl use strict; use warnings; use List::Util qw{ shuffle }; my @numbers = shuffle(1 .. 50); for my $index (0 .. $#numbers) { # replace wi +th 0 .. 25 to stop after 5 lines. print $numbers[$index], $index % 5 == 4 ? "\n" : ' '; }
|
---|