in reply to Using DBI handle in several packages

If they're sharing the same DB handle, then they probably are doing similar things to the database. In that case, create a DB "manager" class that holds the DB handle as a package or lexical var, and then exports routines of choice to the modules that need them. You can also do lazy initialization of the connection that way, since you'll know the state.

I think I gave this solution about a year ago here before. {grin}

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: Using DBI handle in several packages