Re: help me die verbosely

2008-01-18 Thread Chas. Owens
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

Re: help me die verbosely

2008-01-18 Thread Andy Greenwood
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

Re: help me die verbosely

2008-01-18 Thread Chas. Owens
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

Fwd: help me die verbosely

2008-01-18 Thread Jonathan Mast
-- 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

Re: help me die verbosely

2008-01-17 Thread Rob Dixon
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

Re: help me die verbosely

2008-01-17 Thread Chas. Owens
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:

help me die verbosely

2008-01-17 Thread Jonathan Mast
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