What's the problem with this subroutine. This routine provides a random password, its working fine in another script, but giving me an error with a new script. Any ideas?
Error: Missing right curly bracker or square bracket at line no. 7.
I am unable to find that missing curly bracket. Any help would be appreciated.
------------------------------------------
sub encrypt
{
my($plain) = @_;
my(@salt);
@salt = ('a'..'z', 'A'..'Z', '0'..'9', '.', '/');
srand(time() ^ ($$ + ($$ << 15)) );
return crypt($plain,$salt[int(rand(@salt))].$salt[int(rand(@salt))]);
}
----------------------------------------
Thanks,
Zeshan.
Error: Missing right curly bracker or square bracket at line no. 7.
I am unable to find that missing curly bracket. Any help would be appreciated.
------------------------------------------
sub encrypt
{
my($plain) = @_;
my(@salt);
@salt = ('a'..'z', 'A'..'Z', '0'..'9', '.', '/');
srand(time() ^ ($$ + ($$ << 15)) );
return crypt($plain,$salt[int(rand(@salt))].$salt[int(rand(@salt))]);
}
----------------------------------------
Thanks,
Zeshan.