in reply to Re: Subclassing, done right?
in thread Subclassing, done right?

Exactly, when I duplicated the _dav_child subroutine in my Foo.pm wrapper module, it worked.

Strange, as pertoot sais about subs with an underscore: "But this distinction is not enforced by Perl itself." But when it comes to use base, Perl handles these subs different than the rest... So it's a rule, not a style convention... Lesson learned.

Replies are listed 'Best First'.
Re^3: Subclassing, done right?
by Fletch (Bishop) on Aug 06, 2010 at 17:57 UTC

    base doesn't enter into it; all use base does (handwaving slightly here) is use the named module and diddle the using module's @ISA. Since Net::DAV::Server doesn't use Exporter and has no special import sub of its own doing anything similar, nothing (underscore or no) gets imported into the using module's namespace.

    Update: I just re-read your last paragraph of your original question and I think I see what you're misunderstanding:

    Perl inheritance (what base sets up) only affects method calls, not subroutine calls. Since the call is made as a normal subroutine call and not as a method call on an instance inheritance and @ISA never enters the picture.

    That clear anything up?

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      It did.
      And I think I must admit that my knowledge of perl internals, esp. ISA and import/export stuff is still, at least, shaky...

      Thank you all!