in reply to Redirecting STDOUT from internal function with 5.6.1 restrictions
Looks to me like the docs of Test.pm need to be improved. If you look into the source you can see that the module makes a reference to the STDOUT as soon as it's used and then prints to that reference.
Anyway it seems that all you need to do is this:
to redirect the output andopen $Test::TESTOUT, '>', $stdout;
to switch it back.close $Test::TESTOUT; $Test::TESTOUT=*STDOUT{IO};
Jenda
We'd like to help you learn to help yourself Look around you, all you see are sympathetic eyes Stroll around the grounds until you feel at home -- P. Simon in Mrs. Robinson |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Redirecting STDOUT from internal function with 5.6.1 restrictions
by mgc (Novice) on Oct 12, 2004 at 19:10 UTC | |
by Jenda (Abbot) on Oct 12, 2004 at 19:30 UTC | |
by mgc (Novice) on Oct 12, 2004 at 20:43 UTC |
In Section
Seekers of Perl Wisdom