Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Less overkill version' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Less overkill version
Authored by: degackz on Mar 04, '06 11:49:04AM

#!/usr/bin/perl
my $newpw;
my @charset = (('A'..'Z'), ('a'..'z'), (0..9));
my $range = $#charset + 1;
for (1..8) {
   $newpw .= $charset[int(rand($range))];
}
print "password: $newpw\n";


[ Reply to This | # ]
Even less overkill version
Authored by: kenahoo on Mar 05, '06 10:45:19AM

#!/usr/bin/perl
my $newpw;
my @charset = ('A'..'Z', 'a'..'z', 0..9);
$newpw .= $charset[ rand @charset] for 1..8;
print "password: $newpw\n";


[ Reply to This | # ]