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)]; }
In reply to RE: RE: RE: Quicky password sub
by turnstep
in thread Quicky password sub
by halxd2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |