in reply to Re^3: dbi question
in thread dbi question

The connection object ($dbh) is an instance of the DBI class.
Technically, that's not exactly true, but in it pretty much behaves in that way. The class of $dbh is DBI::db.

Why it is done this way, I don't really know. I guess that probably the idea was to restrict the number of methods $dbh has access to.

Replies are listed 'Best First'.
Re^5: dbi question
by dsheroh (Monsignor) on Feb 06, 2010 at 18:45 UTC
    Ah, right. Good catch. That's tripped me up a couple times when writing Moose classes with dbh attributes and I tried making them isa => 'DBI'. One of these days I'll remember about that without having to get it wrong first...