Keep It Simple, Stupid | |
PerlMonks |
Re^2: Capturing STDOUT and STDERR of system command, with pure perl? (files)by EvanK (Chaplain) |
on Aug 24, 2007 at 17:59 UTC ( [id://634928]=note: print w/replies, xml ) | Need Help?? |
It's a wierd caveat, I know, but the command I'm executing could contain anything, including its own file descriptors.
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). So I needed a way to execute the command unaltered, then catch the output. I respect the constructive criticism though. 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 :)
__________
In Section
Seekers of Perl Wisdom
|
|