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:
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.my $status = system '/bin/ls / > /tmp/output 2>&1';
pbeckingham - typist, perishable vertebrate.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Capturing both STDOUT, STDERR and exit status
by merlyn (Sage) on May 06, 2005 at 16:13 UTC | |
Re: Capturing both STDOUT, STDERR and exit status
by polettix (Vicar) on May 06, 2005 at 16:31 UTC | |
by pbeckingham (Parson) on May 06, 2005 at 17:54 UTC | |
by polettix (Vicar) on May 06, 2005 at 22:34 UTC | |
Re: Capturing both STDOUT, STDERR and exit status
by zentara (Archbishop) on May 06, 2005 at 16:40 UTC | |
by greenmoss (Novice) on Jun 02, 2010 at 19:03 UTC | |
Re: Capturing both STDOUT, STDERR and exit status
by saintmike (Vicar) on May 10, 2005 at 17:54 UTC |
Back to
Seekers of Perl Wisdom