On Feb 22, 2005, at 1:54 AM, Tim Bunce wrote:

True. The 'if ref' was a little over the top though. If the user
messes with the contents of $h->{Callbacks} then they get what
they've asked for.

Note that the STORE code for "Callbacks" only gets fired
in a few situations. Specifically, doing

        $h->{Callbacks}->{foo} = ...;

will try to FETCH Callbacks first and if it doesn't exist perl will
STORE an *empty* hash ref which is then returned by the $h->{Callbacks}
expression. The following ->{foo} = ... doesn't trigger any code.

Right. Duh.

Yeap. Just me leaving a trail of breadcrumbs to follow later.

Mmm...delicious.

Yeap. Though the standard way of writing it would be

        if (my $cb = $dbh->{Callbacks}) {
                ...

otherwise $dbh->{Callbacks}{"connect_cached.reused"} will
autovivify the Callbacks hash and so cause a (slight) slowdown in
the method dispatcher for all later uses of the handle.

Right.

That's great. You've got it to the point were I can't ignore it any
more :-)  I'll apply it and finish it up.

Woo! That's what I was looking for! Time well spent, then. :-) I'll have to look at the diff after you've done it to see what I missed.


Many thanks David!

So, do you (or anyone else) fancy doing anything else?...

Gah, not this second. Next time I have an itch to scratch, I'm sure you'll hear from me. I never did finish converting the errors in connect() so that they could *all* use a RaiseError code reference...food for thought.


Cheers,

David



Reply via email to