my @char = ('a' .. 'z', 0 .. 9); my $password = ''; foreach (1..8) { $password .= $char[ rand(@char) ]; } # Using map: my $password = join '', map $char[ rand(@char) ], 1 .. 8;
my @char = ('a' .. 'z', 0 .. 9); my $password = ''; foreach (1..8) { $password .= $char[ rand(@char) ]; } # Using map: my $password = join '', map $char[ rand(@char) ], 1 .. 8;