in reply to How to log all output from a program?

By weird coincidence, clkao just released IPC::Run::SafeHandles, which claims to handle your exact situation better. Maybe this gets merged back into IPC::Run some day but for the meantime, this might be a stopgap measure - the magic seems to get activated when $ENV{FCGI_ROLE} is set, but a look at the code might prove more instructive.