use Object::Virtual; $dbh = Object::Virtual->connect('DBI', $data_source, $username, $auth, \%attr); sleep 120; $dbh->do($statement); # behind the scenes, $dbh is mutated from a virtual object into the actual database handle, and then the statement is done