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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |