Simon Wistow (deflatermouse) wrote,
Simon Wistow

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.

Tags: backend, bizarre, bot, cols, columns, db name, dbd, dbi, dbm, docs, dsn, esque, fetch, luck, rooting, shock, shout, weird

  • This is a call to all my past resignations

    My building, like many here in the fair City O' Fog, has a door entry system which calls a phone number - I can then buzz the door open using the…

  • You Get Me Closer To God

    And ooooooooooooh, the music puns get worse and worse. So, at work we stumbled across an interesting Perlism. Well, interesting if you're a huge…

  • All Tomorrow's Parties

    After my last bit of Calendar fiddling I was left slightly disgusted by the state of the code. In my defence it was written over the course of a…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.