Well, chalk one up for shaving serendipities. This morning while I was shaving, I had a flash--maybe I should've explicitly used eof(INFILE) instead of eof(). Unfortunately, I didn't have time to test it until I got home from work this evening.
Both of the following will work:
if (/$beg/ .. (/$end/ || eof )) { ... }
if (/$beg/ .. (/$end/ || eof(INFILE) )) { ... }
but the original will not:
if (/$beg/ .. (/$end/ || eof() )) { ... }
After figuring this out, I checked a few resources (the best explanation came from perlfunc eof):
An eof without an argument uses the last file read as argument. Using eof() with empty parentheses is very different. It indicates the pseudo file formed of the files listed on the command line, i.e., eof() is reasonable to use inside a while (<>) loop to detect the end of only the last file.
Obvously, I made some faulty assumptions as to how eof() works. Given how seldom I've actually used eof, I should've checked the docs when I first encountered the "freeze-up" problem.
--Jim