- or download this
use Carp qw(carp cluck);
# Print the message with the file and line number included
...
# Print the message with the stacktrace included
cluck("There was an error ['" . $dbh->errstr . "'] in the insert") if
+DEBUG && $debug;
- or download this
perl -MCarp=verbose script.pl
- or download this
$context = sprintf '[%s:%d]', __FILE__, __LINE__;
- or download this
my $message = sprintf "There was an error ['%s'] in the insert", $dbh-
+>errstr;
# Print the message with the file and line number included
...
# Print the message with the stacktrace included
print Carp::longmess($message);