Well right off the bat, there is something wrong with the code you posted. package B defines sub SayByeBye, but it Exports "SayBye". If you want package B to inherit sub SayBye from Package A, you need to use the -> operator, and probably should be using objects access the inherited methods. While the code below will work, I think you need to review why you are using Exporter, and whether you want a procedural approach, or an OO approach.

package A; require Exporter; our @ISA = qw/ Exporter /; our @EXPORT = qw/ SayBye /; our $language = "US-English"; $A::first = "Alpha"; sub SayHello {"hello from package A\n"}; sub SayBye {"Goodbye.\n"} package B; require Exporter; our @ISA = qw/ Exporter A /; our @EXPORT = qw/ SayBye /; $B::first = "Bravo"; sub SayHello {"hello from package B\n"}; sub SayByeBye {print "\$_[0] == $_->[0]\n";$_[0]->SayBye().$_[0] +->SayBye();} package main; ### begin_: get stuff from A print("$A::first\n"); print A::SayHello(); print("$language\n"); print A::SayBye(); print "\n---------------------\n"; ### begin_: get stuff from B print("$B::first\n"); print B::SayHello(); print("$language\n"); print B->SayBye(); ### <-- ERROR Undefined subroutine &amp;B::SayB +ye print B->SayByeBye(); print "\n---------------------\n";
May the Force be with you

In reply to Re: ISA with packages ... A barebones minimal example by JediWizard
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.