http://www.perlmonks.org?node_id=223648


in reply to ??Mnemonic Passwords??

There's a couple of ways to do this. One way is to simply concatenate the pair of letters onto a scalar variable during the loop, and then "encrypt" the scalar when you're done, like:
my $password; for($i = 1; $i <= 4;$i++){ $password .= $c[int(rand(20))] . $v[int(rand(5))]); } my $encrypted_pass = encryption($password);
..and that's it. Note the "." between the two characters, replacing the comma when you were printing the values to the screen. Hope this helps. :-)

Gary Blackburn
Trained Killer