http://qs321.pair.com?node_id=210700


in reply to random elements from array - new twist

Here's my solution... Might not be the cleanest (passing the whole array) but it sure looks pretty...
($\,$,)=("\n","\t"); @a=(1..15); print "Before:",@a; print "Selection:",picksome(5,@a); print "After:",@a; sub picksome { map { splice @_, rand @_, 1 } (1..shift) }