Log in

No account? Create an account

Mon, Apr. 25th, 2005, 01:00 pm
slurping the infobot

In a shock development I actually have a user for Bot::Infobot and, as luck would have it, they're not using the DBI backend which meant I had to go rooting around trying to make the importer work with both the DBI and the DBM backend.

I had high hopes for DBD::DBM except ... it failed dismally, I think because the columns were specifed (although I could have got around that by specifying cols to the dsn) and also because, for some bizarre reasonit won't allow anything other than alphanumerics and underscore in the DB name.

So I ended up doing a sub DBI-esque interface with new(), fetch(), next() and close() . At first I tried to use DBM::Any, the OO wrapper round AnyDBM_File but, after I kept getting errors about file does not exist which was weird because, well, it did exist.

A bit of swear and a shout later until I got rid of

    BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File) }

and it all worked fine. That'll learn me to read the docs properly.