in reply to Randomising the order of an array
I like to do this to randomize an array:
my @shuffled = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [rand(),$_] } @unshuffled;
Update: This wouldn't work (see OP's update)
-Bryan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Randomising the order of an array
by ikegami (Patriarch) on Jul 19, 2005 at 18:49 UTC | |
by Anonymous Monk on Jul 19, 2005 at 20:03 UTC | |
by ikegami (Patriarch) on Jul 19, 2005 at 20:07 UTC | |
by Anonymous Monk on Jul 19, 2005 at 20:14 UTC |