my $outfile = "C:/Work/ING_Occurrences_Companies/ING_Count.txt"; my $infile = "C:/Work/ING_Occurrences_Companies/ING.txt"; open OUT, '>', $outfile or die "can't write '$outfile': $!\n"; open IN, '<', $infile or die "can't read '$infile': $!\n";