Do you know where your variables are? | |
PerlMonks |
Re: How to log all output from a program?by bart (Canon) |
on Oct 15, 2007 at 10:37 UTC ( [id://644882]=note: print w/replies, xml ) | Need Help?? |
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: 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.
In Section
Seekers of Perl Wisdom
|
|