Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: Re: Re: random elements from array - new twistby SpaceAce (Beadle) |
on Nov 07, 2002 at 08:06 UTC ( [id://211016]=note: print w/replies, xml ) | Need Help?? |
It isn't very efficient, though, is it? Every time the loop runs, it has to pick a random number and check/assign the hash key. It could pick the same element several times since the array doesn't change. Also, if for any reason that array was less than five unique elements long you would get an endless loop.
SpaceAce
In Section
Seekers of Perl Wisdom
|
|