I created a simple module that looks up Oracle passwords in a centralized
location so that I don't have to have the password explicitly written in
every piece of code I write. Now, as usual, I'm planning on ruining the
module by making it much more complicated. In particular, I'm planning on
caching database handles. That way, I don't have to pass around the handle
to every subroutine in the program; I can just say &getDBH("SomeHandle") in
each sub.

In order to do this, I'm planning on inheriting from DBI::db. That way, I
can set disconnect() to remove the handle from my cache, so that the dbh
eventually gets DESTROYed. And do other neat things.

My question is, is it safe to inherit from DBI::db? Are there places in the
code that test for ref eq "DBI::db". Hopefully, they use isa(), but I wanted
to make sure. Are there any other concerns I should be aware of?

I thought of using connect_cached and CachedKids, but it seemed a bit
dangerous, especially with the warnings in the docs.

Amir Karger
Curagen Corporation 

Reply via email to