my @chars = ( 'A' .. 'Z', 0 .. 9); my $pw = join('',@chars[ map { rand @chars } ( 1 .. 12 ) ]);