in reply to Redirecting STDOUT to a FileHandle ?

Read perlopentut and FileHandle.
#! /usr/bin/perl -w use FileHandle; $fh=FileHandle->new(">blarg"); die 'Not open' unless defined $fh; open(STDOUT, ">&".$fh->fileno) or die "Argh: $!"; print "foo bar\nbaz\n"; $fh->close();
Hope this helps,

Jeroen
"We are not alone"(FZ)

Replies are listed 'Best First'.
Re: Re: Redirecting STDOUT to a FileHandle ?
by chb (Deacon) on Apr 04, 2001 at 12:49 UTC
    Hey, thanks, that looks better
    - chb