$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}
In reply to Re: hash of hashes
by shmem
in thread hash of hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |