pattyj has asked for the wisdom of the Perl Monks concerning the following question:
I've been googling for a while now and can't find a simple example which makes me think "aha! this is a good way to do it!"
Here is my predicament:
./somebinary | ./myscript.pl
I'd like myscript.pl to capture the output from the run of somebinary, as well as the exit code.
The output is easy enough, but the exit code seems very elusive. In pure bash I would fiddle around with $PIPESTATUS, but I'd like the perl way of doing this. A nice perl way of doing it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capturing the stdout and exit code from a program piped to perl
by LanX (Saint) on Dec 09, 2014 at 11:50 UTC | |
|
Re: Capturing the stdout and exit code from a program piped to perl
by Anonymous Monk on Dec 09, 2014 at 11:23 UTC | |
by Anonymous Monk on Dec 09, 2014 at 13:00 UTC | |
by Anonymous Monk on Dec 09, 2014 at 13:02 UTC | |
|
Re: Capturing the stdout and exit code from a program piped to perl
by Laurent_R (Canon) on Dec 09, 2014 at 21:46 UTC | |
by Anonymous Monk on Dec 11, 2014 at 11:48 UTC | |
by Laurent_R (Canon) on Dec 11, 2014 at 12:37 UTC |