in reply to Re: Problem creating a singleton wrapper around DBI
in thread Problem creating a singleton wrapper around DBI

Before you return the object, you have to store it in the singleton holder:

$oneTrueSelf = DBI->connect ( $datasource, $dbuser, $dbpass ); # some error checking to ensure you have an object ... return $oneTrueSelf;

If you run into other problems, check out how Apache::DBI does it.

--
brian d foy <brian@stonehenge.com>

Replies are listed 'Best First'.
Re^3: Problem creating a singleton wrapper around DBI
by skx (Parson) on Aug 23, 2005 at 04:23 UTC

    Good followup, thanks.

    I've updated the code to test for errors as you suggest, and work as directed.

    All is well now.

    Steve
    --