in reply to Re: comparing an ID fom one file to the records in the second file
in thread comparing an ID fom one file to the records in the second file

You said:

my $keys = {}; while (<FILEHANDLE>) {chomp; $keys[$_] = 1;}

$keys is not an array, you've defined it as a hash reference. You meant $keys->{$_} ....

Then you said:

exists($keys, $recordArray[2])

exists() does not work like that.

exists $keys->{$recordArray[2]};

Please, if you don't test the code you supply, acknowledge that in writing.