Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This way I can call multiple subroutines that use the db without having to constantly create db connections.$dbh=new db connection #some code here that calls subroutines sub test{ $sth=$dbh->prepare(etc..) } sub test2{ $sth=$dbh->prepare(etc..) }
Is there a better way to do this?$dhb=new db connection Test::Package->($dbh); #call sub with db connection
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Database Connections
by Fastolfe (Vicar) on Jan 15, 2001 at 19:43 UTC | |
by ichimunki (Priest) on Jan 15, 2001 at 19:51 UTC | |
by Anonymous Monk on Jan 15, 2001 at 20:04 UTC | |
by Fastolfe (Vicar) on Jan 15, 2001 at 20:19 UTC | |
by chipmunk (Parson) on Jan 15, 2001 at 20:23 UTC | |
|
Re: Database Connections
by merlyn (Sage) on Jan 15, 2001 at 19:48 UTC |