in reply to Redirecting STDOUT to a FileHandle ?

How about something like this (it is much cleaner).
use POSIX qw(dup2); use FileHandle (); my $fh = FileHandle->new(">blarg"); dup2(STDOUT->fileno,$fh->fileno); print $fh "Um... Yah\n";
I think this will be much easier to follow.

Replies are listed 'Best First'.
Re: Re: Redirecting STDOUT to a FileHandle ?
by Rhandom (Curate) on Apr 04, 2001 at 20:26 UTC
    (Maybe next time I will log in first)