in reply to How can I avoid creating two instances of the same object
...and the User and Company packages should call MyDbConnection::get_dbh()package MyDbConnection; use DBI; #... our $dbh; sub get_dbh { unless $dbh { #real connection here } return $dbh; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I avoid creating two instances of the same object
by Anonymous Monk on Mar 02, 2006 at 15:21 UTC |