Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Capturing STDERR using IO::Handle

by xdg (Monsignor)
on Nov 26, 2007 at 21:39 UTC ( [id://653096]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Capturing STDERR using IO::Handle
in thread Capturing STDERR using IO::Handle

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.

  • Comment on Re^4: Capturing STDERR using IO::Handle

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://653096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found