Once you open a file...
open(INPUT, "+>file");
*STDERR = *INPUT;
should do it I think
-Original Message-
From: Russell Boyd [mailto:[EMAIL PROTECTED]]
Sent: 04 February 2002 22:56
To: [EMAIL PROTECTED]
Subject: STDERR
How do you put STDERR to a file for the duration of the perl program
On Mon, 4 Feb 2002, Pfeiffer, Richard wrote:
> Trying to get STDERR to not print to the screen but rather to a file, or
> better yet, an array.
> Easy to do in UNIX (because I know how, of course):
> vcs -v >file.out 2>&1
>
> but how would I do it in Perl? I've tried a few variations of: p
# To capture the error use:
open(OLDERR, ">&STDERR") or die $!; # backup filehandle
open(STDERR, ">standard_errors") or die $!; # errors go here now
## do your stuff here
open(STDERR, ">&OLDERR") or die $!; # restore filehandle
-Original Message-
From: Pfeiffer, Richard [mailto:[EMAI
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Peter Lemus) wrote:
> I would like to send all errors and messages to a
> file, but also to the screen when the script execute.
you need IO::Tee
http://search.cpan.org/search?dist=IO-Tee
--
brian d foy <[EMAIL PROTECTED]> - Perl services for
Hello Walter,
Saturday, October 27, 2001, Walter Grace <[EMAIL PROTECTED]> wrote:
WG> I have a script that is called from the web that has 'warn' statements
WG> embedded.
WG> Regarding the 'warn' statements: Where does STDERR output get sent by default?
WG> How can I redirect it to a specif
Hi,
I think this is possible
while (<>) {
open(STDERR > /file)
close(STDERR)
}
I think thats right (I'm rather new to perl).
HTH,
Thomas Adam
- Original Message -
From: Conrad, Bill (ThomasTech) <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 12:41 PM
Subjec
RE: Collecting error output from child processes on Win32
==
I think this will work:
open STDERR,">$logfile" or die $!;
That should close STDERR and reopen it to the specified output, which
child processes will then inherit.
Another tr