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

pbeckingham has asked for the wisdom of the Perl Monks concerning the following question:

I would like to run an external command, and capture the STDOUT, STDERR and the exit status of that command. This will run on *nix, so for example, I can do this:

my $status = system '/bin/ls / > /tmp/output 2>&1';
This will give me the exit status, and allow me to slurp the output. But I am wondering if anyone knows a way for me to do both at the same time. If only IPC::Open3 gave me a way to capture the exit status.



pbeckingham - typist, perishable vertebrate.