Exception Handling

Peter Corlett abuse at cabal.org.uk
Wed Jul 11 14:52:12 BST 2007

On Wed, Jul 11, 2007 at 10:31:22AM -0300, Otávio Fernandes wrote:
> If you're using a web application, I recommend CGI::Carp, because you can
> write an personalized routine to handle application errors. I my case,
> when my scripts return an error (like an die, or any other fail), instead
> my users view "Internal Server Error" (from Apache), they see my error
> routine build with Carp and CGI ... It's very interesting.

I like using CGI::Carp even for non-CGI programs, because you get the
timestamp and name of the script which can be awfully handy if your program
has ended up being launched from cron and buried five levels deep in a maze
of twisty shell scripts, all alike.

It doesn't half confuse the sysadmins when your Perl daemon process logs to
syslog instead of STDERR. It's almost as if they've never used any other
daemonised program in Unix before, or were expecting all Perl to be
something along the level of Matt Wright's code.

More information about the london.pm mailing list