$dbh=new db connection #some code here that calls subroutines sub test{ $sth=$dbh->prepare(etc..) } sub test2{ $sth=$dbh->prepare(etc..) } #### $dhb=new db connection Test::Package->($dbh); #call sub with db connection