in reply to Devel::GC::Helper + DBI

from what I can tell DBI puts some magic on a hash (fake hash?), but doesn't implement some of the necessary iteration methods

I don't have that problem with my copy of DBI and I see FIRSTKEY in the most recent DBI on CPAN.

So you might want to put some more effort into figuring out why your copy of DBI is broken (or give us more information so we can help you do that).

Note that fixing this particular problem is likely as easy as:

sub DBI::FIRSTKEY { () }

which you don't even have to put inside DBI.pm. That's certainly much easier than trying to make XS code tolerant of broken modules.

- tye        

Replies are listed 'Best First'.
Re^2: Devel::GC::Helper + DBI (easy)
by marwatk (Novice) on Sep 29, 2006 at 20:52 UTC
    Hi tye,

    My DBI has DBI::FIRSTKEY as well (in the perl code, not in xs), but it doesn't seem to matter. (I've tried reinstalling the latest DBI). I even went so far as to implement FIRSTKEY in DBI.xs, which did make my error go away, but made Devel::GC::Helper get stuck in an infinite loop.

    Any other suggestions are welcome though.
      I even went so far as to implement FIRSTKEY in DBI.xs, which did make my error go away, but made Devel::GC::Helper get stuck in an infinite loop.

      If your FIRSTKEY didn't return an empty list (or undef?) then you might cause an infinite loop.

      It'd be interesting to figure out what causes this failure of not finding DBI::FIRSTKEY. You seem in a good position to do that, already having a test case and jumping into the C debugger with it. :)

      - tye