DBI 1.31 suggests that lexically scoped variables should
be passed to _new_dbh():

  
<http://search.cpan.org/~timb/DBI/Changes#Changes_in_DBI_1.31,_29th_November_2002>

DBI 1.33 suggests that drivers should no longer pass these
variables to _new_drh() or _new_dbh():

  
<http://search.cpan.org/~timb/DBI/Changes#Changes_in_DBI_1.33,_27th_February_2003>

This leaves set_err() as the sole interface to set error
codes.

But "The Perl DBI Database Driver Writer's Guide" still
suggests that global $err/$errstr/$state variables are
needed for DBI:

  <http://search.cpan.org/~timb/DBI-1.46/lib/DBI/DBD.pm#The_header>

IMO, we can discard the paragraph without substitution.


Steffen
Index: lib/DBI/DBD.pm
===================================================================
--- lib/DBI/DBD.pm      (revision 623)
+++ lib/DBI/DBD.pm      (working copy)
@@ -569,21 +569,8 @@
   package DBD::File;
 
   use strict;
-  use vars qw($err $errstr $state $drh);
+  use vars qw($VERSION $drh);
 
-  $err = 0;             # holds error code   for DBI::err
-  $errstr = "";         # holds error string for DBI::errstr
-  $sqlstate = "S1000";  # holds SQL state    for DBI::state
-
-These variables are used for storing error states and messages.
-Note that most pure Perl drivers do not support the SQL standard error
-indicator SQLSTATE, and for such drivers, the value "S1000" is
-appropriate.
-If your database does support SQLSTATE, then initialize $sqlstate to an
-empty string.
-However, it is crucial to understand that you must not modify them
-directly; see below.
-
   $VERSION = "1.23.00"  # Version number of DBD::File
 
 This is where the version number of your driver is specified.

Reply via email to