in reply to Undertanding fetchall_arrayref Help!

I'll just comment on this part for now:
my $sth = $dbh->prepare($sql, { RaiseError => 1 }); $sth->execute() or die "$!\n";
RaiseError should really be in the connect() call. If it is, then you don't need all the "or die ..." on every DBI method. But if you don't use RaiseError and you do say "or die ..." on every DBI method, then $! is the wrong variable to use in the error message, it should be $DBI::errstr.

Replies are listed 'Best First'.
Re^2: Undertanding fetchall_arrayref Help!
by Anonymous Monk on Apr 24, 2009 at 19:47 UTC
    So I should use this then?
    my $sth_b = $dbh_b->prepare($sql_b, { RaiseError => 0 }); $sth_b->execute() or die "$!\n";
      my $sth_b = $dbh_b->prepare($sql_b, { RaiseError => 1 }); $sth_b->execute();
      or better yet
      my $dbh_b = DBI->connect(..., { RaiseError => 1 }); my $sth_b = $dbh_b->prepare($sql_b); $sth_b->execute();
        That's the least of the issues been asked here!!!
Re^2: Undertanding fetchall_arrayref Help!
by Anonymous Monk on Apr 25, 2009 at 03:02 UTC
    I guess there is no answer to this issue!?