Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Capturing STDERR using IO::Handle

by Sidhekin (Priest)
on Nov 26, 2007 at 15:48 UTC ( #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
Node Status?
node history
Node Type: note [id://653008]
help
Chatterbox?
[marioroy]: All because File::Find is not fun for LA.
[marioroy]: good night Discipulus.
[Discipulus]: perl dreams to you all
[marioroy]: LA my @music_times = qx(find \$HOME/Music/ Albums -type f -iname \'*.mp3\' -exec mp3info -p \"%S\\n\" {} \\;);
[marioroy]: Only 2 backslash \\n
[marioroy]: LA no space before Albums

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2017-04-23 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.