for (0..($#arr-1)) { # Your Version $n = int (rand() * ($#arr - $_ + 1)) + $_; for ($i = @$array; --$i; ) { # Fisher-Yates my $j = int rand ($i+1);