Brian Raven wrote
>As an alternative to my previous suggestion, why not define your plugins
>as Perl classes. In this way each file being edited can have an object
>of the appropriate plugin class associated with it, which would make it
>easier to edit multiple files at once.
>So you might have something like:
>sub get_plugin_object {
> my $name = shift;
> my $result = eval "use Plugin::$name; Plugin::$name->new;";
> die $@ if $@;
> return $result;
>}
>Perhaps you could derive your plugin classes from a common base class
>that has an autoload function which could catch calls to undefined
>plugin functions and do something sensible.
>Of course code is not unloaded, that may not be possible. You don't say
>why you want to unload/destroy the plugin code. Is it important?
This is a great idea. I have to give it more though.
The reason I wanted to destroy the eval was that there are certain default
sub-routines the plugin might have. If the plugin has them I want to execute
them rather then the default logic contained within the editor. If the user
closes a file and opens a different one I don't want plugin logic associated
with the old file executed against the new file. Also, any memory allocated
by the plugin is no longer needed when the file is closed.
=================================
Atos Euronext Market Solutions Disclaimer
=================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender
immediately and delete it from your system. The views expressed in this
message do not necessarily reflect those of Atos Euronext Market Solutions.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet
e-mail vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de
votre systeme. Le contenu de ce message electronique ne represente pas
necessairement la position ou le point de vue d'Atos Euronext Market
Solutions.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs