diff --git a/misc/export_records.pl b/misc/export_records.pl index 284e12da5b..cfb163ecdc 100755 --- a/misc/export_records.pl +++ b/misc/export_records.pl @@ -173,8 +173,9 @@ elsif ( $record_type eq 'auths' ) { } @record_ids = uniq @record_ids; -if ( @record_ids and my $id_list_file ) { - my @filter_record_ids = <$id_list_file>; +if ( @record_ids and $id_list_file ) { + open my $fh, '<', $id_list_file or die "Cannot open file $id_list_file ($!)"; + my @filter_record_ids = <$fh>; @filter_record_ids = map { my $id = $_; $id =~ s/[\r\n]*$//; $id } @filter_record_ids; # intersection my %record_ids = map { $_ => 1 } @record_ids;