in reply to Re: Please Review First Program: Random Password Generator
in thread Please Review First Program: Random Password Generator

Thanks ikegami. If I understand you correctly, you mean to place each included character randomly in the character pool list first, then randomly select a position from that list (per iteration). That makes a lot of sense. I will implement that.

-- hakkum

...never forget the hakkum bakkum,
the hakkum bakkum never forgets...
  • Comment on Re^2: Please Review First Program: Random Password Generator

Replies are listed 'Best First'.
Re^3: Please Review First Program: Random Password Generator
by ikegami (Patriarch) on Feb 04, 2011 at 05:03 UTC
    Maybe? Not sure. I mean
    use List::Util qw( shuffle ); my @passwd; push @passwd, $letters[ rand(@letters) ] for 1..$num_letters; push @passwd, $digits[ rand(@digits ) ] for 1..$num_digits; push @passwd, $symbols[ rand(@symbols) ] for 1..$num_symbols; push @passwd, $chars[ rand(@chars) ] for 1..($length-$num_letters- +$num_digits-$num_symbols); my $passwd = join '', shuffle @passwd;