(Using DBI 1.40, AS Perl 5.8.2 on WinXP) I've updated a (pure perl) DBD to use set_err() instead of explicitly setting its internal DBD::XXX::err/errstr/state variables. But now I'm getting some odd behavior when I catch/report the errors from an app. Note: in every instance, the driver uses the "set_err($err, $errstr, $state)" form of the method.
When an error is thrown (with RaiseError/PrintError turned off, no HandleError defined), and I "die $h->errstr", it prints out the errstr, then reports an "Use of uninitialized value in die". (This also applies to warn's). Also, it seems that once I reference the $h->errstr(), an uninit warning is reported every time I reference the errstr again until something else is performed on the handle. Questions: 1. I have retained the internal err(), errstr(), and state() methods in the DBD::XXX::db and DBD::XXX::st packages; should these be removed ? Are they being called by the DBI layer and possibly causing the issue ? 2. Does the DBD still need to provide the Err, Errstr, and State attributes to the driver attribute hash ? 3. In reviewing the docs, in DBI.pm, set_err() is described as a handle method ie, $h->set_err(). But in the DBD.pm, the examples use $h->DBI::set_err(). Which is correct ? 4. Does DBI internally clear the err/errstr/state info, or does the DBD need to properly clear these when operations complete successfully ? TIA, Dean Arnold Presicient Corp. www.presicient.com
