RazorbladeBidet means the loop may in fact be ending without you realizing it because of buffering. If select(STDOUT); $|=1; helps, it means the problem is actually after the loop, and that you got fooled into thinking it was within the loop because the printed data was still in a buffer.
OK, thanks, that works. The next part of the code involves searching my newly created multidimensional array for duplicate entries but in other positions (and it's a fairly large text file to begin with), which takes a while, which is likely what I was experiencing while not seeing the next (apparently buffered) "print" statements.
I have other questions about efficient searching/matching inside an array, but that's a subject for another thread and I have to go out now :)