Help for this page

Select Code to Download


  1. 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;
    
  2. or download this
        perl -MCarp=verbose script.pl
    
  3. or download this
    $context = sprintf '[%s:%d]', __FILE__, __LINE__;
    
  4. 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);