Contents of CatchErrors.pm follows: ----------------------------------- use strict; use CGI::Carp qw(fatalsToBrowser set_message); use Mail::Sender; BEGIN { sub email_problem { my $sender = new Mail::Sender({ from => 'errors@yourdomain.com', smtp => 'smtp.server.com'}); $sender->MailMsg({ to => $Error::email, subject => $ENV{SCRIPT_NAME}, msg => $_[0]}); print "Website Error"; } set_message(\&email_problem); } sub import { $Error::email = $_[1] || 'errors@yourdomain.com'; } 1; -------------------------------------- Then, in your perl script, simply include the following line: use CatchErrors qw(recipient@yourdomain.com);