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.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |