Perl: the Markov chain saw | |
PerlMonks |
Re: Capturing STDERR using IO::Handleby ysth (Canon) |
on Nov 26, 2007 at 09:11 UTC ( [id://652948]=note: print w/replies, xml ) | Need Help?? |
You are suffering from a little confusion. The fdopen method doesn't associate some other filehandle with your IO::Handle; it's the other way around: after the fdopen, your $stderr will be associated with whatever STDERR was before (only with the incorrect 'r' mode).
To capture STDERR of a system call, you'd want the stderr output to go to some temporary file and then (rewind if necessary and) read from the file.
In Section
Seekers of Perl Wisdom
|
|