Without a relevant code example its hard to say what's going on. I would expect it to die if it exhausted the FDs available to the process. Looking at the latest source of File::Slurp, write_file() closes its filehandle in the normal course of events, and doesn't catch exceptions that would be thrown by resource exhaustion.