DBI::PurePerl (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
DBI::PurePerl -- a DBI emulation using pure perl (no C/XS compilation required)SYNOPSIS
BEGIN { $ENV{DBI_PUREPERL} = 2 } use DBI;
DESCRIPTION
This is a pure perl emulation of theHowever, if you are in a situation where it isn't possible to install a compiled version of standard
EXPERIMENTAL STATUS
DBI::PurePerl is new so please treat it as experimental pending more extensive testing. So far it has passed all tests withUSAGE
The usage is the same as for standard
DBI_PUREPERL == 0 (the default) Always use compiled DBI, die if it isn't properly compiled & installed DBI_PUREPERL == 1 Use compiled DBI if it is properly compiled & installed, otherwise use PurePerl DBI_PUREPERL == 2 Always use PurePerl
You may set the environment variable in your shell (e.g. with set or setenv or export, etc) or else set it in your script like this:
BEGIN { $ENV{DBI_PUREPERL}=2 }
before you "use DBI;".
INSTALLATION
In most situations simply installIn the situation in which you can not install
For example:
cp DBI.pm /usr/jdoe/mylibs/. cp PurePerl.pm /usr/jdoe/mylibs/DBI/.
Then add this to the top of scripts:
BEGIN { $ENV{DBI_PUREPERL} = 1; # or =2 unshift @INC, '/usr/jdoe/mylibs'; }
(Or should we perhaps patch Makefile.PL so that if
DIFFERENCES BETWEEN DBI AND DBI::PurePerl
Attributes
Boolean attributes still return boolean values but the actual values used may be different, i.e., 0 or undef instead of an empty string.Some handle attributes are either not supported or have very limited functionality:
ActiveKids InactiveDestroy AutoInactiveDestroy Kids Taint TaintIn TaintOut
(and probably others)
Tracing
Trace functionality is more limited and the code to handle tracing is only embedded into DBI:PurePerl if theParameter Usage Checking
TheSpeed
DBI::PurePerl is slower. Although, with some drivers in some contexts this may not be very significant for you.By way of example... the test.pl script in the
my $null_dbh = DBI->connect('dbi:NullP:','',''); my $i = 10_000; $null_dbh->prepare('') while $i--;
In other words just prepares a statement, creating and destroying a statement handle, over and over again. Using the real
May not fully support hash()
If you want to use type 1 hash, i.e., "hash($string,1)" with DBI::PurePerl, you'll need version 1.56 or higher of Math::BigInt (available onDoesn't support preparse()
TheDoesn't support DBD::Proxy
There's a subtle problem somewhere I've not been able to identify. DBI::ProxyServer seem to work fine with DBI::PurePerl but DBD::Proxy does not work 100% (which is sad because that would be far more useful :) Try re-enabling t/80proxy.t for DBI::PurePerl to see if the problem that remains will affect you're usage.Others
can() - doesn't have any special behaviour
Please let us know if you find any other differences between
AUTHORS
Tim Bunce and Jeff Zucker.Tim provided the direction and basis for the code. The original idea for the module and most of the brute force porting from C to Perl was by Jeff. Tim then reworked some core parts to boost the performance and accuracy of the emulation. Thanks also to Randal Schwartz and John Tobey for patches.
COPYRIGHT
Copyright (c) 2002 Tim Bunce Ireland.See