in reply to How to log all output from a program?
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:
Now the command will send its output to stdout.txt and stderr.txt respectively.open STDOUT, ">stdout.txt"; open STDERR, ">stderr.txt"; system($commandline);
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.
|
|---|