in reply to Re^3: Altering Package Subs and Running In To Problems
in thread Altering Package Subs and Running In To Problems
(dunno how to quote atm.) Well, I'm not really asking to step on anyone's toes, just for some help. I'm mostly in it for the fun.
About subclassing:
I was also thinking of developing something like a DynamicModule module, or looking for one on CPAN (havent done any research yet), which would be an alternate for Exporter. It would allow you to pass arguments to your module (basically simplifying the import confusion with a hash (maybe)).
This on its own wouldnt do anything profound, but combined with the Plugins, you could have your base module acquire different plugins at runtime. (this, however, clashes with my compile-time desires)
Also, thought i havent tested it, it seems as if regular Perl inheritance works alongside my Plugin idea (though possibly being really complicated). Though writing different plugins which are all based on an abstract plugin sounds pretty cool.
Easier is not the idea. Im not trying to change the world here.
Would my system help.. hmm. Sounds like it could... maybe.
In a simple case like this (one level of inheritance, only overloading one sub) the 'plugin method' sounds alot like a regular OO one, but perhaps if you wanted to test some code before you fully implement it, you could use a plugin. If your code was open source, plugins could be written at just about any level of your inheritance tree.
Counting packages could work too, since overloading subs (even though they are "written" into other packages) remember their package.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Altering Package Subs and Running In To Problems
by Aighearach (Initiate) on Nov 11, 2004 at 11:25 UTC |