Perl random password generator

This is an little example how to generate some password with numbers,lower letter, upper letter and some special chars in Perl :

use strict;

print   randPW(join("",0..9),3).
        randPW(join("",'A'..'Z'),4).
        randPW(join("",'a'..'z'),4).
        randPW("+-*:;!@",3).$/ for(0..10);


sub randPW {
my @arr = glob(("{".join(",",split("",$_[0]))."}")x$_[1]);
return($arr[int rand($#arr)])    
}

Some random passwords:

728UEJXjltw+!+
019PBRPzsgm+-+
266MQSDizmg:!:
327YNEXqsgt:@:
183XTANfktm;-;
812BMXEpbwz::;
108TAFJbcve;+!
288SMLIbqko!!@
393JTJXoktj--:
702IKLHfetm++!
875VQUKmsyy+;:

3 thoughts on “Perl random password generator”

  1. Its such as you learn my mind! You appear to know a
    lot about this, like you wrote the guide in it or
    something. I believe that you simply can do with a few percent to power the message home a bit, however instead of
    that, this is wonderful blog. An excellent read. I’ll certainly be back.

  2. I think the admin of this site is really working hard in support of
    his site, for the reason that here every stuff is quality based stuff.

Leave a Reply

Your email address will not be published.

18 + twenty =