my @items; for ( 1 .. $n ) { push @items, $a[ rand @a ]; }