"R McGlue" <> wrote in message
news:ch21u2$omd$...
> Paul Lalli wrote:
>
> > my $logfile = '/home/errs.txt';
> > open STDERR, '>>', $logfile or die "Could not redirect STDERR: $!";
> >
> > (Note: Perl is smart enough to not lose track of the original STDERR
if
> > the open fails here, so the die message will still be printed to
> > wherever STDERR is pointing if $logfile cannot be opened for
appending.)
> >
> so if carp was to return and error message it would get written to
> /home/errs.txt
> ?
Any message printed to STDERR, including those printed by carp(), would
be printed to whatever file you named in $logfile (/home/errs.txt in
this case), yes.
Paul Lalli
|