Question 1

B::... means look in package B specifically, not B and its base classes. Use B->... to do what you want:

print B->SayBye();

Keep in mind that sends an extra argument to SayBye, and SayBye's prototype is ignored if one is specified.

Question 2

You'll need to add a 1; at the end of each .pm file, but that's it.

Question 3

Your @ISA should probably be set at compile time:
BEGIN { our @ISA = ... }

Your Exporter code won't export anything until you move the packages to seperate files (because import never gets called). It's costumary to do Exporter stuff at compile time, yet it seems to work as is as well. (Update: It said the opposite earlier, until I realized inline code is probably executed before import is called. I tested it for confirmation.) You might want to get rid of Exporter completely if you're using Module->. Also, although not a bug, it's rarely nice to use @EXPORT instead of @EXPORT_OK.


In reply to Re: ISA with packages ... A barebones minimal example by ikegami
in thread ISA with packages ... A barebones minimal example by Anonymous Monk

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.