in reply to trapping database errors
my $mailbody; my $sth = $dbh->prepare($sqla); eval { $sth->execute(); }; if ($@) { $mailbody .= "Cannot insert into $database \n"; } else { $sth->finish(); # but why? probably not needed } [download]