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