Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Redirecting STDOUT

by Sidhekin (Priest)
on Feb 11, 2007 at 13:14 UTC ( #599457=note: print w/replies, xml ) Need Help??

in reply to Redirecting STDOUT

Test::More->diag() and other test methods are not printing to STDOUT, but to three Test::Builder file handles that default to (dupes of) STDOUT/STDERR/STDOUT respectively.

If you want them all to print to your local STDOUT, I guess this would do it:

my $Test = Test::Builder->new; my @handle_names = qw/ output failure_output todo_output /; my %old; $old{$_} = $Test->$_ for @handle_names; $Test->$_(\*STDOUT) for @handle_names; eval { run_your_tests }; # and restore: $Test->$_($old{$_}) for @handle_names;

For more detail, see Test::Builder.

Update: I couldn't stand to see the cut-and-pasted list of handle names, so I added a variable for it. How's that for obsessive? :-P

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://599457]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-07-16 05:18 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (332 votes). Check out past polls.