Audience:
mod_perl hackers
What you will learn:
How to cleanly handle exceptions in mod_perl
Outline:
Every time I hear someone suggest using:
use CGI::Carp qw/fatalsToBrowser/;
I cry out in pain! There are reasonably clean ways to handle when a script dies in Perl, and trapping $SIG{__DIE__} is not one of them. In this talk we will explain why $SIG{__DIE__} is considered harmful if not used carefully, and how to more cleanly handle exceptions. We will talk about some of the modules available on CPAN for increasing the flexibility of Perl's exception handling, such as Error.pm and Exception::Class, and cover how these modules can give you a full backtrace when exceptions occur. A lot of this is a concept generally useful in Perl, but we will talk about how it applies to mod_perl and our use cases will focus on mod_perl.