in reply to Is there a CGI::Carp fatalstoEmail ?

There isn't a standard 'fatalsToEmail' pragma for the CGI::Carp module, however it would not be particularly difficult to build such functionality using the set_message method. This method allows a subroutine to be specified which is called with the text of the error message that caused the script to die - For example:

use CGI::Carp qw/ fatalsToBrowser set_message /; use Mail::Mailer; BEGIN { sub fatalsToEmail { my $error = shift; my $smtp = Mail::Mailer->new('smtp', Server => '127.0.0.1'); $smtp->open({ 'To' => 'you@yourdomain.com', 'From' => 'you@yourdomain.com' }); print $smtp $error; $smtp->close; } set_message(\&fatalsToEmail); }

As outlined in the CGI::Carp man page, the set_message routine should be called from within a BEGIN in order to correctly interpret compile-time errors.