Here's a little code snippet that might help you on your way
this will generate a random pwd of letters and number between 4 and 8 chars.
sub usrpwd { #usage $var=usrpwd();
my @letters = ('a'..'z');
my $string;
for (0..int(rand(4) + 4)) {
$_ = int(rand(2));
if (/0/) {
$string .= $letters[rand(26)];
} else {
$string .= int(rand(10));
}
} #for
return $string;
} #sub
Regards,
Jos Boumans
----- Original Message -----
From: "cherukuwada subrahmanyam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 05, 2001 12:02 PM
Subject: generating passwords
> Hi,
> Is there any easy way to generate random string of particluar length.
> The idea is to generate passwords randomly.
> I did it using rand function i.e. generating random number and replacing
the
> number with corresponding alphabet.
> Is there any easy way???
> thanks,
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>