Gossamer Forum
Home : General : Perl Programming :

Destroying a database handle

Quote Reply
Destroying a database handle
If I have a module that returns a statement handle to be used somewhere else, what is the best way to finish() and disconnect() or is it done automatically?

eg....

Module1:

my $sth = $DB->table('Foo')->select;

SQL Module:

sub select { ...code... return $sth }

When I've done what I want in Module1 can I just forget about $sth or should I have a method in the SQL module to destroy the database handle?

I heard somewhere that DBI destroys it automatically. Is that right?
Subject Author Views Date
Thread Destroying a database handle Paul 3714 Mar 30, 2002, 4:50 AM
Thread Re: [Paul] Destroying a database handle
sponge 3602 Mar 30, 2002, 6:00 AM
Thread Re: [King Junko II] Destroying a database handle
Paul 3562 Mar 30, 2002, 7:05 AM
Thread Re: [Paul] Destroying a database handle
Alex 3549 Mar 30, 2002, 9:02 AM
Thread Re: [Alex] Destroying a database handle
Paul 3577 Mar 30, 2002, 9:44 AM
Thread Re: [Paul] Destroying a database handle
Alex 3573 Mar 30, 2002, 9:46 AM
Post Re: [Alex] Destroying a database handle
Paul 3561 Mar 30, 2002, 9:47 AM