use Carp qw(carp cluck); # Print the message with the file and line number included carp("There was an error ['" . $dbh->errstr . "'] in the insert") if DEBUG && $debug; # Print the message with the stacktrace included cluck("There was an error ['" . $dbh->errstr . "'] in the insert") if DEBUG && $debug;