Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 289827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:56:32+00:00 2026-05-12T05:56:32+00:00

Thanks to everyone in advance. I’ve been doing some research on error handling and

  • 0

Thanks to everyone in advance.

I’ve been doing some research on error handling and I don’t feel like I’m getting a solid understanding of what I should do.

Preamble: My code is living in Apache and executed in the browser, my goals don’t include command line execution.

I’d like to have the behavior of CGI::Carp (fatalsToBrowser) with the ability to capture the output and be able to throw it in my own templated page, email it etc… I did notice that fatalsToBrowser doesn’t work with mod_perl. Does anyone know why? How is Apache/mod_perl getting in the way?


First Goal: I’d like to put something together that works if the code is being executed with mod_perl or mod_cgi.

Second Goal: I’d like to have a high-level method(s) that catches all the errors similar to .NET’s Application_Error (in global.asax) and PHP’s set_exception_handler() and set_error_handler() methods. These allow you to take control when an error is raised, without wrapping code in messy/gross try-catch statements.


Things I’ve read/reviewed:

1.) OO Exception Handling in Perl, but wasn’t what I was looking for. Most of the stuff I want to catch is die()ing. The next link also says that this article is out of date and deprecated.

2.) Perl: $SIG{__DIE__}, eval { } and stack trace, but I didn’t get much from this related to my goals.

3.) Practical Mode Perl (O’Reilly), Chapter 21 “Error Handling and Debugging”. Thankfully all my perl code uses strict and warnings are enabled, and most important things mentioned in Chapter 6 “Coding with mod_perl in Mind” are already done.

4.) I’ve dug through the tables of contents in “Learning Perl”, “Perl Cookbook”, “Programming Perl” and “Higher Order Perl” and didn’t see anything that stuck out at me. If you think I missed something there please let me know. 🙂


I don’t remember where (maybe in “Practical mod_perl”, but I’ve read that you should not mess with $SIG{__DIE__}.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:56:32+00:00Added an answer on May 12, 2026 at 5:56 am

    Have you read the mod_perl website’s bit on Alternative Exception Handling Techniques? It discusses about how you can catch uncaught exceptions though the use of overriding the global die() function instead of using $SIG{__DIE__}. A much cleaner method but not perfect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi everyone and thanks in advance for the help. So I have been learning
Thanks to everyone out there helping newbies like me. So far I have this:
Hello and thanks to everyone for reading my question. I've been working on a
Thanks to everyone in advance - So I went ahead and implemented this code:
That's my first post here. Thanks in advance everyone that collaborates with me. I'm
Thanks to everyone in advance - I have yet to find an easy way
Thanks to everyone in advance, I have overridden HTTPServletResponse that collects headers and also
Thanks to everyone in advance, I am trying to access any context parameters in
Thanks to everyone in advance - I need to load a preference before any
Thanks to everyone in advance! I have attached a nsIWebProgressListener to a xul:browser and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.