Attatched is a copy of PurePerl that passes 271/271 t/* subtests with the following tests skipped:
* proxy.t -- skipped
* preparse.t -- skipped
* basics.t
* skipped 2 of the subtests on neat() which depend on
looks_like_number() telling the difference between "2"
and 2
* skipped 5 subtests depending on hash()
That's all. Everything else passes. It needs a slight patch to DBI.pm
(also attatched) to bypass the bootstrap (default=use DBI,1=enable
PurePerl only if no loadable DBI, 2-force use of PurePerl) and to not
croak if PurePerl sets $DBI::err.
It emulates dispatch() with the IMA bitmasks, KEEP_ERR, class_depth,
etc.. It does not use lasth. All of the error/state passing is through
$DBI::err and friends.
*However* it contains this line in _setup_handle():
$DBI::PurePerl::frump = $h;
The variable is not used anywhere else, it functions only to keep $h
alive after everything else is destroyed (which I *do* know is what we
want to avoid). If it is commented out, then 4 errors appear in
examp.t. subtests which use eval (150,151,166,168). All of the errors
are because the test is expecting $@ to contain something and it is
empty. I have checked, and the croak/RaiseError is working properly and
has the message $@ is expecting but $@ never gets it. Unless I keep the
handle alive with frump, then $@ works as it should. Is there any
other way to make sure $@ is propagated properly?
--
Jeff
217c217,228
< bootstrap DBI;
---
> if ( $ENV{DBI_PUREPERL} ) {
> if ( $ENV{DBI_PUREPERL} == 1 ) {
> eval { bootstrap DBI };
> }
> if ($@ or $ENV{DBI_PUREPERL} == 2 ) {
> require DBI::PurePerl;
> }
> }
> else {
> bootstrap DBI;
> }
>
263c274,277
< sub DBI::var::STORE { Carp::croak("Can't modify \$DBI::${$_[0]} special
variable") }
---
> sub DBI::var::STORE {
> Carp::croak("Can't modify \$DBI::${$_[0]} special variable")
> unless $DBI::PurePerl and ${$_[0]} =~ /(\*err|&errstr|"state)/
> }
PurePerl.pm
Description: application/unknown-content-type-pm_auto_file
