test1(); test2(); sub test1 { $dbh=new MyDBLayer; $dbh->do(etc..); } sub test2 { $dbh=new MyDBLayer; $dbh->do(etc..); }