summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c3
-rw-r--r--pod/perlobj.pod6
2 files changed, 9 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index f18f174d6e..22e419ec24 100644
--- a/gv.c
+++ b/gv.c
@@ -418,6 +418,9 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method)
return Nullgv;
cv = GvCV(gv);
+ if (!CvROOT(cv))
+ return Nullgv;
+
/*
* Inheriting AUTOLOAD for non-methods works ... for now.
*/
diff --git a/pod/perlobj.pod b/pod/perlobj.pod
index 4e45aff7c6..9a9bda94d9 100644
--- a/pod/perlobj.pod
+++ b/pod/perlobj.pod
@@ -168,6 +168,12 @@ the method that was intended to be called.
If none of that works, Perl finally gives up and complains.
+If you want to stop the AUTOLOAD inheritance say simply
+
+ sub AUTOLOAD;
+
+and the call will die using the name of the sub being called.
+
Perl classes do method inheritance only. Data inheritance is left up
to the class itself. By and large, this is not a problem in Perl,
because most classes model the attributes of their object using an