in reply to FileHandles in a Hash

I agree with the sentiment that you should File::Find the targets first.   Then, I think that you should open them, process them, and close them one-by-one.   Generally it is not a good idea to have too-many files open at one time:   you are quite likely to run into environment-specific limits and who knows what those limits might be.   So, it’s best simply not to go there.

I suggest that you can simply push the names onto an ordinary array, in stage-one (finding files), then pop them off again in stage-two (processing).   And please note that I advise for these two steps to be cleanly separated.   In some OS environments, the act of opening a file can mess-up a search, regardless of the programming language that is used.   So, it’s best simply not to go there, either.