For small hashes, ordering isn't necessarily "random" from one hash to the next:
Same results under ActiveState 5.8.9 and Strawberry 5.14.4.1.c:\@Work\Perl\monks>perl -wMstrict -le "for (1 .. 8) { my @k = keys %{ { map { $_ => 1 } 0 .. 8 } }; print qq{@k}; } " 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5 6 3 7 2 8 1 4 0 5
Give a man a fish: <%-{-{-{-<
In reply to Re^4: Pick k numbers at random -- hash keys
by AnomalousMonk
in thread Pick k numbers at random
by Chuma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |