Job sorted, it works!!!
Thanks you all for your help.
Gus
-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: 19 February 2002 15:20
To: '[EMAIL PROTECTED]'
Subject: Re: Changing STDERR
From: "Laycock, Angus" <[EMAIL PR
From: "Laycock, Angus" <[EMAIL PROTECTED]>
> Can someone tell me how to change STDERR to output to a file then
> change it back to its original output.
#!perl -w
print STDERR "First msg\n";
use vars qw(*ORIGSTDERR); # to make -w happy
ope
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
Please,
Can someone tell me how to change STDERR to output to a file then change it
back to its original output.
my $oldout = select STDERR;
print STDERR "test1\n";
open STDERR, ">test.txt" or die "Can't open file STDERR [OUTPUT]";
print STDERR "test2\n";# goes to file
select $ol