Does the line with the sort
result in a more random array or is the sort
here only a waste?
use List::Util qw(shuffle);
@random1 = shuffle sort keys %vocables;
@random2 = shuffle keys %vocables;
If placing a sort before the shuffle made a difference, then shuffle would be broken. Since shuffle works, the sort is a waste of processor time. The whole point of a good shuffle is to eliminate any pre-existing ordering of the elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With