in reply to reading from an arbitrary number of files using anonymous file handles
Although not part of the OP's question, I think it is a bad idea to open all the files in advance of reading from any. This makes the code more fragile than it needs to be.