in reply to scope and undef

You can try an explicit disconnect instead of simply assigning undef to the "database object". I assume you use DBI:
$rc = $dbh->disconnect or warn $dbh->errstr;
I would recommend you to include which database engine you are using, what modules you use to access it, and a small code sample that illustates your problem.

--

Replies are listed 'Best First'.
Re^2: scope and undef
by Ryszard (Priest) on Aug 28, 2007 at 10:28 UTC
    thanks for your answer, however, my initial question isnt about the database per se. the database object is just a symptom of the actual problem about why the object is not collected when it "goes out of scope" using the undef.

    removal of the undef statement fixed the problem, i now have a single persistent database connection.