Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: [Suggestion] How to get plugin registry into a global?: Edit Log

Here is the list of edits for this post
[Suggestion] How to get plugin registry into a global?
Currently we can get plugin registry locally into a variable, by using similar code:

Code:
my $plugin_registry = Links::Plugins->get_plugin_registry("myplugin");
But we have to call this function in every sub we want to use it. To avoid this, would be fine to load plugin Registry for current plugin, into a Global hash variable (%REG), so we will not spend time in each sub to reload the registry.

I mean something similar as we load the main globals using this code:
Code:
use Links qw/$DB $IN $USER $CFG %REG/;

We can load plugin registry into a %REG global, like this:
Code:
$REG{"myplugin"} = Links::Plugins->get_plugin_registry("myplugin");
So this is the way how I will do right now.

Alex may add a way into next release, to import the %REG global variable of plugins, into current package we use...

Waiting opinions! Any of them are welcome.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Jul 6, 2002, 6:22 AM

Edit Log: