sub can { my ($self, $method) = @_; # Not shift, using goto. # The call to UNIVERSAL::can() should be inside an eval EXPR # to get caller info right for when $method =~ /^SUPER::/, # if can() is exported (see Class::AUTOCAN below). my $universal = UNIVERSAL::can($self, $method); if (not defined $universal) { if (my $code = _autoloaded($self, $method)) { return $code; } } if (my $next = $self->next::can) { goto &$next } return $universal; # May be undefined. }