Perl: the Markov chain saw | |
PerlMonks |
Re^4: Capturing STDERR using IO::Handleby xdg (Monsignor) |
on Nov 26, 2007 at 21:39 UTC ( [id://653096]=note: print w/replies, xml ) | Need Help?? |
Apart from the STDOUT typos above when redirecting STDERR, this approach is prone to dying if STDOUT or STDERR are already closed for some reason. Also, under wperl.exe on MSWin32, what you have may cause a segfault. IO::CaptureOutput can deal with those kinds of edge cases for you. Update: I misread the intent of the code example -- it's not a typo, it's merging STDERR and STDOUT intentionally. -xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Seekers of Perl Wisdom
|
|