On Perl

EMAIL: ADITYA (DOT) SINGH (AT) GMAIL

Name:
Location: Chicago/Delhi, United States

Monday, July 11, 2005

Password generator

A simple routine to make passwords.


sub makePassword{
my $length = shift;
@chr = (0..9,'A'..'Z','a'..'z');
$passwd .= @chr[rand @chr] for 1..$length;
return $passwd;
}

print makePassword(10);
print makePassword(5);
print makePassword(1);

0 Comments:

Post a Comment

<< Home