pwgen.pl
author Peter Gervai <grin@grin.hu>
Wed, 07 May 2014 16:25:00 +0200
changeset 0 624a9ab34425
child 3 d4bb4405d439
permissions -rwxr-xr-x
Add code lying around to the repo

#!/usr/bin/perl
# $Id$
# (c)Peter Gervai, 2002; Released under GPLv2 + CC_BY-SA-2.0
#
# jelszogenerator, 2002/04/08
#

if( $ARGV[0] =~ /shutup/i ) { $shutup = 1; $num=1; } else { $num = 6; }

$vowel='aeiou';
#$cons='bcdfghjklmnpqrstvwxyz';
 $cons='bcdfghjklmnprstvxyz';

$vlen=length($vowel);
$clen=length($cons);


$longsyl=20; # percent
$sylnum=4 + rand(3);

print "$num tok jo jelszo: " unless $shutup;



for (1..$num) {
    for my $i (1..$sylnum) {
        print substr($cons,rand($clen),1);
        print substr($vowel,rand($vlen),1);
        print substr($cons,rand($clen),1) if $longsyl > rand(100);
        #print "-";
    }
    print "  " unless $shutup;
}

print "\n";
print "\n" unless $shutup;