On Feb 19, Laycock, Angus said:

>Can someone tell me how to change STDERR to output to a file then change it
>back to its original output.

Look at the documentation for open().  It shows you how to temporarily
change a filehandle.  Here are the first four lines of code:

  open(OLDOUT, ">&STDOUT");
  open(OLDERR, ">&STDERR");

  open(STDOUT, ">foo.out") || die "Can't redirect stdout";
  open(STDERR, ">&STDOUT") || die "Can't dup stdout";

The rest await you at 'perldoc -f open'.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to