📄 dbi::pureperl.3
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "DBI::PurePerl 3".TH DBI::PurePerl 3 "2007-09-26" "perl v5.10.0" "User Contributed Perl Documentation".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"DBI::PurePerl \-\- a DBI emulation using pure perl (no C/XS compilation required).SH "SYNOPSIS".IX Header "SYNOPSIS".Vb 2\& BEGIN { $ENV{DBI_PUREPERL} = 2 }\& use DBI;.Ve.SH "DESCRIPTION".IX Header "DESCRIPTION"This is a pure perl emulation of the \s-1DBI\s0 internals. In almost allcases you will be better off using standard \s-1DBI\s0 since the portionsof the standard version written in C make it *much* faster..PPHowever, if you are in a situation where it isn't possible to installa compiled version of standard \s-1DBI\s0, and you're using pure-perl \s-1DBD\s0drivers, then this module allows you to use most common featuresof \s-1DBI\s0 without needing any changes in your scripts..SH "EXPERIMENTAL STATUS".IX Header "EXPERIMENTAL STATUS"DBI::PurePerl is new so please treat it as experimental pendingmore extensive testing. So far it has passed all tests with \s-1DBD::CSV\s0,DBD::AnyData, DBD::XBase, DBD::Sprite, DBD::mysqlPP. Please sendbug reports to Jeff Zucker at <jeff@vpservices.com> with a cc to<dbi\-dev@perl.org>..SH "USAGE".IX Header "USAGE"The usage is the same as for standard \s-1DBI\s0 with the exceptionthat you need to set the enviornment variable \s-1DBI_PUREPERL\s0 ifyou want to use the PurePerl version..PP.Vb 2\& DBI_PUREPERL == 0 (the default) Always use compiled DBI, die\& if it isn\*(Aqt properly compiled & installed\&\& DBI_PUREPERL == 1 Use compiled DBI if it is properly compiled\& & installed, otherwise use PurePerl\&\& DBI_PUREPERL == 2 Always use PurePerl.Ve.PPYou may set the enviornment variable in your shell (e.g. withset or setenv or export, etc) or else set it in your script likethis:.PP.Vb 1\& BEGIN { $ENV{DBI_PUREPERL}=2 }.Ve.PPbefore you \f(CW\*(C`use DBI;\*(C'\fR..SH "INSTALLATION".IX Header "INSTALLATION"In most situations simply install \s-1DBI\s0 (see the \s-1DBI\s0 pod for details)..PPIn the situation in which you can not install \s-1DBI\s0 itself, youmay manually copy \s-1DBI\s0.pm and PurePerl.pm into the appropriatedirectories..PPFor example:.PP.Vb 2\& cp DBI.pm /usr/jdoe/mylibs/.\& cp PurePerl.pm /usr/jdoe/mylibs/DBI/..Ve.PPThen add this to the top of scripts:.PP.Vb 4\& BEGIN {\& $ENV{DBI_PUREPERL} = 1; # or =2\& unshift @INC, \*(Aq/usr/jdoe/mylibs\*(Aq;\& }.Ve.PP(Or should we perhaps patch Makefile.PL so that if \s-1DBI_PUREPERL\s0is set to 2 prior to make, the normal compile process is skippedand the files are installed automatically?).SH "DIFFERENCES BETWEEN DBI AND DBI::PurePerl".IX Header "DIFFERENCES BETWEEN DBI AND DBI::PurePerl".Sh "Attributes".IX Subsection "Attributes"Boolean attributes still return boolean values but the actual valuesused may be different, i.e., 0 or undef instead of an empty string..PPSome handle attributes are either not supported or have very limitedfunctionality:.PP.Vb 6\& ActiveKids\& InactiveDestroy\& Kids\& Taint\& TaintIn\& TaintOut.Ve.PP(and probably others).Sh "Tracing".IX Subsection "Tracing"Trace functionality is more limited and the code to handle tracing isonly embeded into DBI:PurePerl if the \s-1DBI_TRACE\s0 environment variableis defined. To enable total tracing you can set the \s-1DBI_TRACE\s0environment variable as usual. But to enable individual handletracing using the \fItrace()\fR method you also need to set the \s-1DBI_TRACE\s0environment variable, but set it to 0..Sh "Parameter Usage Checking".IX Subsection "Parameter Usage Checking"The \s-1DBI\s0 does some basic parameter count checking on method calls.DBI::PurePerl doesn't..Sh "Speed".IX Subsection "Speed"DBI::PurePerl is slower. Although, with some drivers in somecontexts this may not be very significant for you..PPBy way of example... the test.pl script in the \s-1DBI\s0 sourcedistribution has a simple benchmark that just does:.PP.Vb 3\& my $null_dbh = DBI\->connect(\*(Aqdbi:NullP:\*(Aq,\*(Aq\*(Aq,\*(Aq\*(Aq);\& my $i = 10_000;\& $null_dbh\->prepare(\*(Aq\*(Aq) while $i\-\-;.Ve.PPIn other words just prepares a statement, creating and destroyinga statement handle, over and over again. Using the real \s-1DBI\s0 thisruns at ~4550 handles per second whereas DBI::PurePerl manages~2800 per second on the same machine (not too bad really)..Sh "May not fully support \fIhash()\fP".IX Subsection "May not fully support hash()"If you want to use type 1 hash, i.e., \f(CW\*(C`hash($string,1)\*(C'\fR withDBI::PurePerl, you'll need version 1.56 or higher of Math::BigInt(available on \s-1CPAN\s0)..Sh "Doesn't support \fIpreparse()\fP".IX Subsection "Doesn't support preparse()"The \s-1DBI\-\s0>\fIpreparse()\fR method isn't supported in DBI::PurePerl..Sh "Doesn't support DBD::Proxy".IX Subsection "Doesn'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::Proxydoes 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 problemthat remains will affect you're usage..Sh "Others".IX Subsection "Others".Vb 1\& can() \- doesn\*(Aqt have any special behaviour.Ve.PPPlease let us know if you find any other differences between \s-1DBI\s0and DBI::PurePerl..SH "AUTHORS".IX Header "AUTHORS"Tim Bunce and Jeff Zucker..PPTim provided the direction and basis for the code. The originalidea for the module and most of the brute force porting from C toPerl was by Jeff. Tim then reworked some core parts to boost theperformance and accuracy of the emulation. Thanks also to RandalSchwartz and John Tobey for patches..SH "COPYRIGHT".IX Header "COPYRIGHT"Copyright (c) 2002 Tim Bunce Ireland..PPSee \s-1COPYRIGHT\s0 section in \s-1DBI\s0.pm for usage and distribution rights.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -