$file = 'test_predictions_1'; open (FH, ") { $id = $_; if (exists $data{$file}{$id}) {print "match\n";} }