use String::Random; my $pw = String::Random::random_string('10101022',[split //,uc 'aei'],[split //,uc 'bdfghklmnprstwxz'],[split //,'23456789']);