As perlop says,To read both a command's STDOUT and its STDERR separately, it's easiest to redirect them separately to files, and then read from those files when the program is done.Of course, you could also try using IPC::Open3.
But beware that trying to read both STDOUT and STDERR separately using Perl and IPC::Open3 can be a good way to discover what "deadlock" means. You'd need to use something like select (select doesn't work on pipes on Win32 and the equivalent that does work isn't packaged up for easy use from Perl) or have two threads of execution, so coding this correctly may be much more complicated than using a temporary file or two.
- tye
In reply to Re^2: capturing stderr of a command, invoked via backticks (pipeS)
by tye
in thread capturing stderr of a command, invoked via backticks
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |