is this a fair way to shuffle an array:
Algorithm::Numerical::Shuffle's or List::Util's shuffle() are ok, but if it can be done in a one liner shorter than the one shown in How do I shuffle an array or in the FAQ, that'd be preferable.my @a = (1..10); my @b; push @b, splice @a, rand @a, 1 while @a;
And, does any of you perlgolfer-monks have an idea on how to transform the snippet above into one that's working in-place?
In reply to Is this a fair shuffle? by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |