##
my $dbh = shift;
my $sth = shift;
...
if ($sth) {
$sth->finish();
} else {
' '->finish(); # RUNTIME ERROR
}
if ($sth) {
$dbh->disconnect();
} else {
' '->diconnect(); # RUNTIME ERROR
}
####
my $dbh = shift;
my $sth = shift;
...
$sth->finish() if $sth;
$dbh->disconnect() if $dbh;