in reply to Global or not global
One option is to put your data manipulation in a class (or classes), and as it is instantiated, pass a database handle to the object. Then the constructor requires that you pass a handle to it. Store it as an object attribute. If you're using something like Moose you could encapsulate your database handle in a role and mix it into classes that require access. Of course "mixins" or roles aren't unique to Moose; you could achieve similar with good old-fashioned Perl objects too.
Dave
|
|---|