> perl -MCarp -e '$SIG{__WARN__} = sub { $err = shift; }; 
> carp "Error!\n"; print "We caught $err";'
> 

This works great!

And changing $SIG{__WARN__} to '' will return default behaviour correct?
(Same thign with __DIE__ ??)

> Strangely though, this did not work for me, though I expected it to:
> 
> perl -MCarp -e '$SIG{__DIE__} = sub { $err = shift; }; croak 
> "Error!\n"; print "We caught $err";'
> 

Anyone have any idea how to get $SIG{__DIE__} to act like the $SIG{__WARN__} ?
I'm sure it has something to do with die doing an exit() or soemthing.

> James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to