![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: rand + shift || popby kennethk (Abbot) |
on Dec 21, 2010 at 15:28 UTC ( [id://878288]=note: print w/replies, xml ) | Need Help?? |
In addition to the lovely splice-based approaches listed above, if you are simply using your array as a grab-bag and have no need to maintain order, combining shuffle from List::Util (core) with pop or shift should yield a cleaner solution:
Note this is discussed in perlfaq4's How do I shuffle an array randomly?.
In Section
Seekers of Perl Wisdom
|
|