use Crypt::GeneratePassword qw(chars); my $pwd = chars(9,16,["a".."z","A".."Z",0..9]);