in reply to Re: reading an input file
in thread reading an input file

duff , I don't know much about hash , how would I print the output ? thanks

Replies are listed 'Best First'.
Re: Re: Re: reading an input file
by duff (Parson) on Jan 23, 2004 at 03:46 UTC

    Reading perldata should give you some more clues about perl's built-in data structures (like hashes). To print the contents of the hash, you could do something like this:

    for my $user (keys %passwds) { print "$user $passwds{$user}\n"; # outputs user and password }

    In the hash I created in the original snippet of code I gave the %passwds hash held the usernames and passwords. Usernames were the keys of the hash, passwords were the values. This loop just iterates over the keys and outputs each key (user) and it's associated value (password).