develooper Front page | perl.beginners | Postings from August 2009

removing a 'tee'd file handles going forward

Thread Next
From:
Tony Esposito
Date:
August 26, 2009 08:36
Subject:
removing a 'tee'd file handles going forward
Message ID:
491641.13061.qm@web24615.mail.ird.yahoo.com
I want to output to both STDOUT and STDERR at one point in my program, then want to separate the two handles going forward in the program so that output is sent to STDOUT and STDERR separately.  Given the code snip below, would the "undef tee" do the trick?
 
use IO::Tee;

my $tee = new IO::Tee(\*STDOUT,\*STDERR);
$tee->print("Hi\n"); 
$tee->flush;

# some code here ... blah, blah, blah ...
# now want to change to set and 'untee' STDOUT and STDERR ...

undef tee;   # is this going to do it?

Thanks.


      
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About