Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: how to loop through hash tables more efficiently

by choroba (Bishop)
on Sep 17, 2012 at 20:53 UTC ( #994101=note: print w/replies, xml ) Need Help??

in reply to updated_again: how to loop through hash tables more efficiently

Can you please specify what output you expect from the given sample files and why? You code does not output anything. To make it ouput something, I had to add the key among its values in hash1:
It then prints all the keys from hash2. That is probably not what you wanted.

BTW, my ($hash1, $hash2)= @ARGV or die "$!"; will return strange errors (or none at all) if no arguments are supplied.

@ARGV == 2 or die "Specify two arguments.\n";
should work better. Also, using double quotes in readhash("$hash1") where $hash1 is a file name is useless. Just readhash($hash1);.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994101]
[erix]: the hackers might...
[1nickt]: Ah yes, I meant Uber :-/
[erix]: that's fair enough, they have leaked enough ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-11-22 14:33 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (324 votes). Check out past polls.