http://qs321.pair.com?node_id=198592

pmme has asked for the wisdom of the Perl Monks concerning the following question:

Hi all

I have been using the following script to create passwords for user accounts, and just got my wrists slapped because it is not creating md5 passwords, instead, its just creating plain crypt passwords.
my @chars = ('a'..'z', 'A'..'Z', 0..9); my $password = do {{ local $_ = join "" => map {$chars [rand @chars]} 1..8; redo unless /[a-z]/ && /[A-Z]/ && /\d/; $_; }}; my $salt = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]; my $encrpass = crypt($password, $salt);
I have looked into Digest::MD5, but i am lost on how to use it.

Help would be much apprecaited.