http://www.perlmonks.org?node_id=143334


in reply to picking multiple random elements out of an array

for(1..5){ my $r = rand @array; push @subset,$array[$r]; $array[$r] = $array[-1]; pop @array; }