in reply to Redirecting STDOUT to a FileHandle ?
If you want it shorter...use POSIX qw(dup); use FileHandle (); my $fd = dup(STDOUT->fileno); my $fh = FileHandle->new(); $fh->fdopen($fd,'w'); print "Um... Yah\n";
The first is more readable.my $fh - FileHandle->new(); $fh->fdopen(dup(fileno(STDOUT)),'w');
|
|---|