Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: picking multiple random elements out of an array

by I0 (Priest)
on Feb 05, 2002 at 01:30 UTC ( [id://143334] : note . print w/replies, xml ) Need Help??


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; }