On Jun 23, Me said:

>> I want STDOUT to be sent to a FILESHANDLE. I have a script writing
>output
>> DISPLAY..But I wanna this to be going into a file through FILEHANDLES
>..
>>
>> Ur Help is Highly APPRECIATED
>
>    open(STDOUT, ">foo") or die "can't redirect STDOUT: $!";

It's probably easier (and more reversible) to merely select() a different
default filehandle.

  print "foo";  # to STDOUT

  $old = select NEWFH;

  print "bar";  # to NEWFH

  $old = select $old;

  print "BAR";  # to STDOUT

  $old = select $old;

  print "FOO";  # to NEWFH

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to