That gave me an idea...
values %{ map { rand() => $_ } @list };
And for those of you who haven't applied Tilly's Patch® by hand and rebuilt your copy of perl and for whom performance is important:
- tye (but my friends call me "Tye")sub { my %hash; for(@list){ $hash{rand()}= $_ }; return values %hash }
In reply to Hashing the order out of an array (Re: Randomize an array)
by tye
in thread Randomize an array
by Zebu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |