in reply to Re: random elements from array - new twist

in thread random elements from array - new twist

You have a bad shuffle. It does not give equal odds of all combinations coming up. It trivially cannot, if your array has n elements then all of your probabilities have to be multiples of 1/n**n which does not evenly divide n! - the number of possible permutations you are choosing between.

How to do it right is a FAQ.

In Section
Seekers of Perl Wisdom