my $fh = $nbdc_filehandles[$index]; $_ = <$fh>; # instead of # $_ = <$nbdc_filehandles[$index]>;