my $dbh = DBI->connect( ... ); my $query_obj = MyQuery->new( $dbh ); my $answer = $query_obj->do_query( $key );