'Resolve the given CITDL expression (starting at the given
scope) down to a non-import/non-variable hit: i.e. down to a
function or class (a.k.a., Perl package).'

def _hit_from_citdl(self, expr, scoperef, defn_only=False):

    self._check_infinite_recursion(expr)
    tokens = list(self._tokenize_citdl_expr(expr))
    first_token = tokens.pop(0)
    hit = self._hit_from_first_part(first_token, scoperef)
    if (not hit):
        raise CodeIntelError(("could    not    resolve    '%s'" % first_token))
    while tokens:
        token = tokens.pop(0)
        if (token == '()'):
            raise CodeIntelError(('eval    of    Perl    function    calls    not    yet    implemented:    %r' % expr))
        self.info("lookup    '%s'    on    %r    in    %r", token, *hit)
        hit = self._hit_from_getattr(token, *hit)
    if tokens:
        raise CodeIntelError(("multi-part    Perl    CITDL    expr    '%s'    cannot    yet    be    handled" % expr))
    (elem, scoperef) = hit
    if ((elem.tag == 'variable') and (not defn_only)):
        hit = self._hit_from_variable_type_inference(elem, scoperef)
    self.info("'%s'    is    %s    on    %s", expr, *hit)
    return hit
