http://qs321.pair.com?node_id=362610


in reply to Re^5: Abstracting Class::DBI Database Connection Data
in thread Abstracting Class::DBI Database Connection Data

Can't locate object method "connect_cached" via package "Ima::DBI" at MyCDBI.pm line 4.

gryphon
code('Perl') || die;

  • Comment on Re^6: Abstracting Class::DBI Database Connection Data

Replies are listed 'Best First'.
Re^7: Abstracting Class::DBI Database Connection Data
by perrin (Chancellor) on Jun 09, 2004 at 03:59 UTC
    Sorry, that was a copy/paste from the mailing list. You can just call DBI->connect_cached(), but you have to set some other things that are described on the mailing list. That's the best place to look for this info.

    However, I think you're making it too hard. The only thing wrong with what you have is that you are passing data around by serializing it and sticking it in %ENV. Why not just make your $cfg object available from other classes? Stash it in a global and then make a simple accessor like MyCfg::get_cfg() that MyCDBI can call to get it.