in reply to RE: RE: Quicky password sub
in thread Quicky password sub
You can also just say rand(@password_chars) and get rid of the $num_char variable entirely.
Also, as long as your are hard coding the iteraction as 'for (1..8)' you can gain even more speed by just doing it like this: (forgive my shortening of password_chars)
You could even take out the "return"!sub Pass { return $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)] . $p_c[rand(@p_c)]; }
|
|---|