Tim Bunce wrote:
> 

[other good advice snipped but heeded]

I've added the bitmask checking for IMA_STUB, IMA_KEEP_ERR,
IMA_COPY_STMT, and IMA_FUNC_REDIRECT.

> > sub set_err {
> >     my($h,$errnum,$msg,$state)=@_;
> >     $msg = $errnum unless defined $msg;
> >     #z
> >     # Avert your eyes if you don't want to see a horrendous kludge
> >     #   (and check DBI::var::FETCH for the other half)
> >     $DBI::zerr    = $errnum;
> >      ...
> 
> You can reasonably assume that's going in the wrong direction :)
> Talk to me about the problems you were trying to solve here.
> There's bound to be a better way.

The problem is that $DBI::err and friends are not being set.  Another
way I can get around that with almost as good results and without
inventing any new variables like $DBI::zerr, is to patch DBI.pm like so:

    sub DBI::var::STORE    {
        return $DBI::var::STORE_PP(@_) if $DBI::PurePerl;
        Carp::croak("Can't modify \$DBI::${$_[0]} special variable") 
    }

But maybe I'm missing a more obvious way to let $DBI::err be set on its
own. Or maybe I'm just not fetching it via the pointers correctly.

-- 
Jeff

Reply via email to