You are doing the opposite of inheritance. :-)

Normally you would write the subclass and use the subclass. The subclass gets methods from both the parent and itself, without needing to include the parent in itself. Going the other way would be seriously problematic. Somewhere you need to load the module that implements the subclass, and somewhere you need to place its functionality where needed.

As for your import question, you will need to do some work. Off of the top of my head I might suggest just initializing your @EXPORT and @EXPORT_OK to be your parents, and then either import all of the method into your space, or else have an AUTOLOAD that will import and rethrow at run-time. (So it is slow the first time and faster afterwards.)

I also suspect that when you are done this example you will find that if you go back and do it again you will see ways to improve and will learn a lot more. This usually is the case when learning something new, it is only with some experience that you get the insight you need to see how to use the ideas you learned in concrete problems.


In reply to Re (tilly) 1: How do I create a submodule transparent to its parent without modifying the parent? by tilly
in thread How do I create a submodule transparent to its parent without modifying the parent? by deprecated

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.