while ( ... ) { open my $fh, '<', $inputFile or warn( "Unable to open analysis file $inputFile: $!\n" ); next unless defined $fh ... }