> you don't have to call srand. perl will do this for you.
Technically, only versions of perl 5.004 and higher will
call srand for you. Also note that if you are
using a pre-5.004 version, srand alone
uses time as the seed, which is generally Not Very Random.
It will probably do in this case. So calling srand explicitly is
actually the safest, most portable way to do it. Or you could be
really proper and call srand depending on the version of perl
detected.
Also, here is a simpler way to create a random string.
Just has to use this one today, actually. (Yes, it's in the
Perl Cookbook, but I came up with it on my own :p)
@letters = ('A'..'Z','a'..'z',0..9,qw(! # $ % ^ | _));
$randomstring = join("", @letters[map {rand @letters} (1..8)]);
|