in reply to Problem locating Carp::Heavy

I'm pretty sure Carp::Heavy is a core module, or at least it appears to be one in my distribution (Fedora Perl 5.8.3 RPM). So it sounds like there's something screwy in your Perl installation. You might need to refresh/reinstall Perl on your system. You can also search your system for the file Carp/Heavy.pm to see if it's there, but if you do find it don't just copy it into Perl's lib directory unless you're sure it's the right version.

Of course, this is only coming into the picture because some module is trying to tell you something. So I would first try getting rid of RaiseError in your DBI call, and add

or die $db->errstr;
after your execute call.

Replies are listed 'Best First'.
Re^2: Problem locating Carp::Heavy
by Miguel (Friar) on Apr 07, 2005 at 03:06 UTC
    Thank you for your suggestion.

    I tried with:

    $db->{RaiseError} = 0; ... $sth->execute( $to || "-", $from || "-", $subject || "-", $date || "-", $body || "-", $headers || "-" ) or die $db->errstr;
    But I still got the same result.

    And seems I do have Carp::Heavy on my system:

    ~% slocate Heavy.pm /usr/lib/perl5/5.8.6/Carp/Heavy.pm /usr/lib/perl5/5.8.6/Exporter/Heavy.pm
    On the other hand, if I just do:
    #!/usr/bin/perl -Tw use diagnostics; use strict; use IO::All; use DBI; my $db = DBI->connect( "dbi:Pg:dbname=db;", "user", "password" ) or die( "error message ..." ); $db->{RaiseError} = 1; $db->{pg_server_prepare} = 1; $db->{AutoCommit} = 1; my $sql = " INSERT INTO tabmail(para,de,assunto,data,corpo,cabecalho) VALUES(?,?,?,?,?,?) "; my $sth = $db->prepare($sql); for ( 1 .. 2000) { $sth->execute($_,$_,$_,$_,$_,$_) or die $db->errstr; }
    All records are stored fine.