http://www.perlmonks.org?node_id=993754

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.