sub ErrorHandler { if ($DBI::errstr) { cluck("The following database error occurred:\n $DBI::errstr"); print "Error message to display to your users."; } else { cluck "An error has occurred"; print "Error message to display to your users."; } }