Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Capturing STDERR using IO::Handle

by Sidhekin (Priest)
on Nov 26, 2007 at 15:48 UTC ( [id://653008]=note: print w/replies, xml ) Need Help??


in reply to Capturing STDERR using IO::Handle

This can't be done with simple ties.

It can be done with Test::Trap, though. :) (Shameless as ever ....)

use Test::Trap qw/ :flow:stderr(systemsafe) /; # or similar trap { system 'command', 'with', 'args' }; my @logmessages = split /\n/, $trap->stderr; # chomped! or season to t +aste

Not exclusively for use in test scripts, indeed. :)

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found