In such a case, if I just add new descriptors to the command, the original descriptor is apparently ignored, and the new one is used instead (on OSX anyway; YMMV).# command that redirects STDERR to file $command = 'myapp --flag=somearg 2>>/var/log/myapp.err';
So I needed a way to execute the command unaltered, then catch the output. I respect the constructive criticism though.# NOTHING is written to the original .err file # instead, STDERR is sent to STDOUT qx($command 2>&1)
At any rate, xdg's suggestion works well, and I may end up taking your other advice and temporarily redirect the script's stdout/err to scalars just to avoid the girth of one more dependacy :)
__________
Systems development is like banging your head against a wall...
It's usually very painful, but if you're persistent, you'll get through it.
In reply to Re^2: Capturing STDOUT and STDERR of system command, with pure perl? (files)
by EvanK
in thread Capturing STDOUT and STDERR of system command, with pure perl?
by EvanK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |