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";} }


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.



_($_=" "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}