On Jan 18, 2008 2:45 PM, Andy Greenwood <[EMAIL PROTECTED]> wrote:
snip
> > $SIG{__DIE__} = sub {
> > open my $fh, ">>", "something.log"
> > or die @_, "could not open something.log: $!";
> > print $fh @_;
> > };
> >
> > die "Oops";
> >
>
> Would this not be susceptible to infinite
Chas. Owens wrote:
On Jan 17, 2008 9:54 AM, Jonathan Mast <[EMAIL PROTECTED]> wrote:
I want to write the errors caught by a 'die' clause into a file.
snip
Try
#!/usr/bin/perl
use strict;
use warnings;
$SIG{__DIE__} = sub {
open my $fh, ">>", "something.log"
or die @_, "c
On Jan 18, 2008 10:51 AM, Jonathan Mast <[EMAIL PROTECTED]> wrote:
snip
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > $SIG{__DIE__} = sub {
> >open my $fh, ">>", "something.log"
> >or die @_, "could not open something.log: $!";
> >print $fh @_;
> > };
> >
> > die
-- Forwarded message --
From: Jonathan Mast <[EMAIL PROTECTED]>
Date: Jan 18, 2008 10:50 AM
Subject: Re: help me die verbosely
To: "Chas. Owens" <[EMAIL PROTECTED]>
OK, so were binding an anonymous subroutine to the DIE signal?
Does this need to go abov
Jonathan Mast wrote:
I want to write the errors caught by a 'die' clause into a file.
In others words,
open F ">>somefile.log";
blah->blah or die (print F $@)
but the above does work.
die() sends its output to STDERR, so
open STDERR, '>', 'somefile.log' or die $!;
blah->blah or
On Jan 17, 2008 9:54 AM, Jonathan Mast <[EMAIL PROTECTED]> wrote:
> I want to write the errors caught by a 'die' clause into a file.
snip
Try
#!/usr/bin/perl
use strict;
use warnings;
$SIG{__DIE__} = sub {
open my $fh, ">>", "something.log"
or die @_, "could not open something.log:
I want to write the errors caught by a 'die' clause into a file.
In others words,
open F ">>somefile.log";
blah->blah or die (print F $@)
but the above does work.
thanks