Q:Why are you exporting a method from a base class to an inheriting class? Normally you either export, or you inherit.

A: It didn't seem like exporting was working properly (similar error came up as shown in the first post).

Q: Why are you exporting your import() method?

A: That was a bad idea -- I fixed that later after receiving your suggestion -- no one in my group honestly knows how to use export (just another guy and I know Perl, and it's somewhat limited to say the least in many areas), and it wasn't 100% clear in the Perldoc what to do with Exporter, until you clarified that point. :(..

Q: Why are you even defining an import() method when the one you're inheriting from Exporter should work fine and yours does not? I.e. remove the import() method and fix the obvious syntax errors and you can use your inheir_merge() method from the use()ing package.

A: I tried that and the call failed to do that properly before, but I'll try again..

Q: Why are you creating an an object of the caller's class to call SUPER on when you can call caller()->SUPER::inheir_merge() directly?

A: Right now I was just trying to get the call tree down properly so that I could verify that everything was working like it was supposed to. Next I was going to fill in the blanks in terms of merging the data elements together, instead of having all of the keyed hash items straight out replace one another.

That's most likely not correct though now that I think about it because it will find the inheir_merge() subroutine at the bottom of the call stack, since I won't redefine it anywhere else, and thus it won't do what I want it to do.

Q: And finally, what is all this supposed to do that you can't solve with straightforward (mutiple or single) inheritance?

A: It's the merging part that's the cruxt and the issue in the whole problem. Instead of replacing a keyed hash element I want to append in some cases, search and replace arguments in some other cases, append to arrays in yet other cases, etc.


In reply to Re^2: Dealing with design -- inheritance + exporting gone bad :(.. by yaneurabeya
in thread Dealing with design -- inheritance + exporting gone bad :(.. by yaneurabeya

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.