in reply to hash of hashes
Perhaps this works:
$file = 'test_predictions_1'; open (FH, "<EXAMPLE"); while (<FH>) { chop; # remove trailing newline $id = $_; if (exists $data{$file}{$id}) {print "match\n";} }
<update>
Having a second look at your code:
if (exists $data{$file}{$id}) {print "match\n";}
Does the key $file to the hash $data even exist in the hash?
You could use Data::Dumper to dump your HoH and check if it's what you expect.
</update>
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ / /\_¯/(q / ---------------------------- \__(m.====·.(_("always off the crowd"))."· ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: hash of hashes
by Anonymous Monk on Nov 23, 2006 at 12:11 UTC | |
by jarich (Curate) on Nov 23, 2006 at 14:01 UTC | |
Re^2: hash of hashes
by Anonymous Monk on Nov 23, 2006 at 11:21 UTC |
In Section
Seekers of Perl Wisdom