chrestomanci has asked for the wisdom of the Perl Monks concerning the following question:
Greetings wise brothers.
I am working on a perl program that calls a another executable on my system that I don't control. The second program is rather verbose and emits rather more output than I am not usualy interested in on stderr. I am currently calling it via system $program, @args
Rather than suppress output entirely, I am looking for a way to capture the output and log it via Log::Log4perl, as it may be usefull in future to debug problems. Is there a simple way to do this?
I found this node from 4 years ago, where it appears that the suplicant did control the child process. There is also an FAQ entry which handles the case of a perl module that the users is unwilling to modify by localy replacing print with something that diverts what it receves.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to capture child process output and divert to log4perl
by ww (Archbishop) on Sep 14, 2012 at 18:41 UTC | |
Re: How to capture child process output and divert to log4perl
by kennethk (Abbot) on Sep 14, 2012 at 22:31 UTC | |
Re: How to capture child process output and divert to log4perl
by jandrew (Chaplain) on Sep 14, 2012 at 23:41 UTC | |
Re: How to capture child process output and divert to log4perl
by Anonymous Monk on Sep 14, 2012 at 23:53 UTC |