in reply to Re^2: Can read one txt file and not another?
in thread Can read one txt file and not another?

Removing $in appears to have fixed the problem unless it was something seemingly unrelated I did later in the code that did it (but I doubt that).
If I'm understanding your post correctly, it's completely relevant.

The file that didn't work had all the newlines removed, making the entire file a single line. Since there was only one line in the file, reading the first line into $in and throwing it away... threw away the entire file, leaving nothing for the loop to read.