...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; }
In reply to Re: How can I avoid creating two instances of the same object
by pajout
in thread How can I avoid creating two instances of the same object
by beachguy82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |