in reply to How do I create a submodule transparent to its parent without modifying the parent?
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.
|
|---|