use StandardQueries; ... my $sth = $dbh->prepare(StandardQueries::get_username); ... # some code to get the username using the statement handle #### use StandardQueries; ... my $username = $dbh->get_username($user_id);