You say:
> Undefined subroutine Foo::BarMod::whiz at line 17. > ... > Well, it's a class method, so the first one doesn't really > apply.
No it's not. That's not a class method--that's a fully-qualified subroutine 'whiz' in the class 'Foo::BarMod'. Very much not a class method. You're saying, "call the function 'whiz' in the package 'Foo::BarMod'". But such a function doesn't exist, so Perl doesn't like that.

If you want inheritance, call it as a class method, which is calling it like this:

Foo::BarMod->whiz
(Or indirect object syntax, but that's generally not used much.)

In other words: you came to the right conclusion, but you may have spared yourself quite a bit of confusion and frustration if you had your terms right. Inheritance--ie., checking in @ISA--only occurs for class methods (and object methods). Not for fully-qualified subroutines.


In reply to Re: @ISA, Inheritance, and Class Methods by btrott
in thread @ISA, Inheritance, and Class Methods by clwolfe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.