sub naive_shuffle { my $n = my @p = @_; for my $i ( 0..$n-1 ) { my $j = int rand $n; @p[ $i, $j ] = @p[ $j, $i ]; # swap } return @p; }