use dbmodule; my $dbh; BEGIN {$dbh = DBModule_Start} END {DBModule_Finish} # then do various stuff including $sth = $dbh->prepare("BLAH BLAH") die $dbh->errstr; $sth->execute or die $dbh->errstr; DBModule_Sub1;