On Mon Jul 15 09:14:02 2013, doy@tozt.net wrote:
Show quoted text> On Mon, Jul 15, 2013 at 06:07:50AM -0400, Lukas Mai via RT wrote:
> > The documentation for 'extends' says:
> >
> > | extends (@superclasses)
> > |
> > | This function will set the superclass(es) for the current class.
> >
> > What it doesn't say: In addition to setting up inheritance, in some
> > cases[1] it tries to load corresponding modules from disk first. I
> > find this behavior surprising and it doesn't seem to be documented
> > anywhere. I think this behavior should be documented (or alternatively
> > removed).
> >
> > [1] exact logic hard to describe; see sub _is_class_loaded in
> > Class::Load::PP
>
> Why is this surprising? 'use base' and 'use parent' both work the same
> way. Noting this in the documentation probably wouldn't be a bad idea
> though.
It's surprising because 'extends' is not described as being like base/parent; it's described as setting superclasses, which I understand to be like '@ISA = ...'.
The documentation for base/parent says: "Allows you to both load one or more modules, while setting up inheritance from those modules at the same time."
... i.e. it emphasizes the module loading part that 'extends' doesn't even mention.