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

I have no neat solution for you, just some general remarks...

Tieing filehandles when calling external programs just doesn't work. I bet that is why IPC::Run dies.

What does work for external programs, is redirecting these filehandles to files, or to real filehandles. Child programs will then inherit these filehandles. For example:

open STDOUT, ">stdout.txt"; open STDERR, ">stderr.txt"; system($commandline);
Now the command will send its output to stdout.txt and stderr.txt respectively.

So, what to do...? I'm thinking of using an intermediate program/script, which captures the output from your external program (perhaps with IPC::Open3), reformats it, and prints it out, formatted, to the real log file.