in reply to plugins and inheritance
For this, I would use Exporter. Every plugin loaded (use'd) simply overwrites the main namespace with the new function. It's than up to the plugin to determine if it's right to overwrite or not. You can search the namespace with %::. Additionally, with @EXPORT_OK, the API can determine which names to import.
If you set up the API like this, the order in which the modules are loaded is important. Therefore, add the name of the plugin when it's downloaded to a config file. Upon restart, load the plugins in the specified order, to achieve the same state.
For example, if your API contains the function 'my_sub', the package 'plugin.pm' would EXPORT 'my_sub', thereby overwriting the API's sub.
You can extend this even to OO-perl, methinks.
Hope this helps,
Jeroen
"We are not alone"(FZ)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: plugins and inheritance
by dash2 (Hermit) on Feb 27, 2001 at 20:26 UTC |