If you can get away with it, use DBIx::Recordset instead of
DBI... DBI was designed to be an interface to databases,
not the interface for an application programmer to databases
Solves MANY of the irksome issues associated with DBI.
Check it out on CPAN