With a perl object such as you have here, this can be guaranteed with a DESTROY method:
=pod =item DESTROY Called when the last reference to the object goes away. =cut sub DESTROY { my($self) = @_ ; if( $self->{_dbh } ) { # check in case it was deallocated somewhere else $self->{_dbh}->disconnect() ; } }
In reply to Re: DBI and Modules
by ptkdb
in thread DBI and Modules
by set_uk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |