my @temp_chars; for (1 .. $length) { push @temp_chars, (shuffle(@chars))[0]; }