![]() |
|
Perl Monk, Perl Meditation | |
PerlMonks |
Re: Array issueby pelagic (Priest) |
on Jan 28, 2004 at 20:31 UTC ( #324775=note: print w/replies, xml ) | Need Help?? |
Hi I'll try to explain what each of your stmts does: my ($mkt,$pass) = split; assign first word of line (user or whatever that is) to $mkt and Password (second word of line) to $pass $passwds{$mkt} = $pass; assign Password to hash/key %passwds/$mkt assign User to hash/key %passwds/$pass At the end you got a hash with every User _AND_ every Password as key. The values contain vice versa the Passwords and the Users. Now it's impossible to have just a list of the Passwords because you cannot distict them anymore. just do: $passwds{$mkt} = $pass; in your loop and then you can get all Users or all Passwords like that: Imre PS close if stmt with } before accessing the whole list ...
In Section
Seekers of Perl Wisdom
|
|