http://qs321.pair.com?node_id=183419


in reply to Perl Singletons

There's no point in even returning an instance. Just return the package name:
package DBconnector; my $dbh; sub new { return __PACKAGE__ } sub connect { my $pointless = shift; $dbh ||= DBI->connect($@); }
and so on.

-- Randal L. Schwartz, Perl hacker