Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
I'm wondering what your thoughts are on a coding dilema I seem to have. I'm maintaing some perl scripts, and I'm tidying up the way they connect to the database etc. I have a main Perl script that calls a database package that I wrote. So I simply call the database package and use the database handler accordingly. However the script is then calling in another package (lets call it TABLE), that also makes calls to the database. So I'm trying to figure out the best approach, when creating the object TABLE, should I put the database handler in as one of it's attributes in the new method call, and use that or everytime I use a method/sub routine of TABLE should I pass in the database handle as a parameter? Many thanks in advance Ant UPDATE: The Script and Package will always connect to the same database as the same user. In reply to Best Coding practice by ant
|
|