The latest version made no visible difference. I think throw does something strange with die as I never see the "helloworld" message printed.
Roger use MRFExceptions; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init(); $SIG{__DIE__} = sub { if($^S) { # We're in an eval {} and don't want log # this message but catch it later return; } print "helloworld\n"; $Log::Log4perl::caller_depth++; LOGDIE @_; }; eval { MRF::Exception::Remote->throw('userid'=>"some crappy file"); } or do { print "ERROR "....@."\n"; if ($@) { print "die, die, die\n"; if ($...@->isa('MRF::Exception::Deploy')) { print "MRF::Exception::Deploy [", $...@->userid, "]: $@" ; } else { print "Down the list\n"; } } }; 1; -----Original Message----- From: Mike Schilli [mailto:m...@perlmeister.com] Sent: 09 February 2009 21:42 To: DAY Roger Cc: log4perl-devel@lists.sourceforge.net Subject: Re: [log4perl-devel] Problems with log4perl and __DIE__ pseudo signal On Mon, 9 Feb 2009, DAY Roger wrote: > Good to see the log4perl-devel list up and alive. I've managed to drag > another company into using log4perl, but to business. Good job! :) > I've implemented Matt Sargants recomendations for exception handling > but on the throw method I keep getting a "bad file descriptor" in $@ > when I add the line Log::Log4perl->easy_init(); Is there a way around > this? I think it's the easy_init causing the problem; do I need to > close Log::Log4perl properly, or somesuch? Could this be related to using eval{} and not checking $^S in the __DIE__ handler? http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can _I_make_sure_my_application_logs_a_message_when_it_dies_unexpectedly? -- Mike Mike Schilli m...@perlmeister.com ------------------------------------------------------------------------ ------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel ********************************************************************** The Atradius Group conducts insurance, debt collection and information services business through its registered offices and branch offices in various countries. For information about the main registration details of the Atradius branch offices in your country please visit http://global.atradius.com/general-content/legal/legallist.html IMPORTANT NOTICE. This message, including any and all attachments, is intended for the addressee or its representative only and is confidential and may be under legal privilege. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. If you are not the intended recipient of this e-mail message and its contents, please notify the sender immediately by reply email and delete this message and all its attachments subsequently. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Atradius N.V. or its subsidiaries or affiliates (Atradius Group) either jointly or severally, for any loss or damage arising in any way from its use. Email messages received by Atradius Group can be stored for business purposes. ********************************************************************** ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel