'Find a hit for the first part of the tokens.
Returns a <hit> or None if could not resolve.
Examples:
\'$ua\'    -> <variable \'$ua\'>,
(<blob \'myscript\'>, [])
\'Dumper\' -> <function \'Dumper\'>,
(<blob \'Data::Dumper\'>, [\'Data::Dumper\'])
\'Data::Dumper\' ->
<class \'Data::Dumper\'>,
(<blob \'Data::Dumper\'>, [])'

def _hit_from_first_part(self, first_token, scoperef):

    while 1:
        elem = self._elem_from_scoperef(scoperef)
        if (first_token in elem.names):
            self.log("is    '%s'    accessible    on    %s?    yes:    %s", first_token, scoperef, elem.names[first_token])
            scoperef[1].append(first_token)
            return (elem.names[first_token], scoperef)
        if ('::' not in first_token):
            hit = self._hit_from_elem_imports(first_token, elem)
            if (hit is not None):
                self.log("is    '%s'    accessible    on    %s?    yes:    %s", first_token, scoperef, hit[0])
                return hit
        (mod, pkg) = self.pkg_tbl.mod_and_pkg_from_pkg_name(first_token)
        if (mod is not None):
            self.log("is    '%s'    accessible    on    %s?    yes:    %s", first_token, scoperef, pkg)
            return (pkg, (mod, [first_token]))
        self.log("is    '%s'    accessible    on    %s?    no", first_token, scoperef)
        scoperef = self.parent_scoperef_from_scoperef(scoperef)
        if (not scoperef):
            return None
