Both the User and Company modules subclass thier new method from the same package( the basically get a database connection) How can I avoid having to create two instances of this object. The User and Company modules contain metods to retrieve data from thier related table. It feels like I'm doing something wrong by creating two objects when the new method is the same. The database has nearly 200 tables so I don't want to have load each related module at startup.use Data::Dumper; use Company; use User; my $dbh = User->new(); my $dbh2 = Company->new();
2006-03-02 Retitled by jdporter, as per Monastery guidelines
Original title: 'How to can I avoid creating two instaces of the same object'
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |