in reply to Re^4: Is this a fair shuffle?
in thread Is this a fair shuffle?

sub qshuf { my %hash; sort { ($hash{$a}||=rand 1) <=> ($hash{$b}||=rand 1) } @_; }
That's close, but try it on a list with repetitions:
for (1 .. 10) { print qshuf(qw/a b c D D D D/), $/; }
All the D's in the list get the same random value, so they all tie each other in the comparisons and end up adjacent. You are better off using the Schwartzian Transform I outlined above, where each array position gets a unique random number.

blokhead