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:
@listOfPass = (values %passwds);
@listOfUsers = (keys %passwds);
Imre
PS
close if stmt with } before accessing the whole list ...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.