Can someone give me some direction on the best way to do when sharing a $dbh variable between "objects" in different .pm files.
For instance, my main module say Foo.pm has a new constructor, etc and I could give it a dbh or create a dbh and then share it by passing it as a parameter to the new constructor for Bar.pm, and then re-assigning inside Bar->new, but that seems like I'm doing a lot of work managing this variable.
Is this a simple, yet elegant way to do this? I've researched Exporter and a few other examples, but none seem to be straight forward.
Thanks!
DBI. If that's not the one you was referring to, then your statement is too strong to be true. Having a layer between DB and your business logic is a good practice in some cases (and then you better have one such layer indeed), but not in all cases and not even in the majority of cases, I'd say. There's more than one way to do it, you know.