Temporarily redirecting STDERR
cp at onsitetech.com
Tue Apr 16 10:42:25 CDT 2002
----- Original Message -----
From: "Joe Oppegaard" <joe at joppegaard.com>
To: "PDX Perl List" <pdx-pm-list at pm.org>
Sent: Tuesday, April 16, 2002 12:52 AM
Subject: Temporarily redirecting STDERR
> I'm probably missing something obvious, but I can't seem to find the
> answer. How do you redirect stderr in scope, then have it return to its
> default once you leave that block?
This should do the trick, assuming I understood your question:
open STDERR, "> err.txt" or die $!;
warn "This goes to the file";
warn "This doesn't";
ONSITE! Technology, Inc.
Taking e-Business and Internet Technology To The Extreme!
More information about the Pdx-pm-list