Arshavir Grigorian wrote:
I am wondering if anyone has experience with a framework for dynamically loading certain modules into an application and executing certain code based on whether a certain module is loaded (available or not). By "dynamically", I do not mean loading run-time, only being able to safely exclude certain modules at startup. One place this could come in handy is when selling an app to 2 clients of whom one has purchased all the functionality and the other has not, and you don't want to give them certain module(s). I am guessing one could accomplish this by using a macro processor (m4) to preprocess Perl code before it's "released", but it would probably be somewhat painful.
I'm just finishing a plugin architecture which dynamically loads available plugins, but in doing so I found some useful CPAN modules:
Module::Optional - exactly what you're after Module::Pluggable - very flexible plugin/optional module manager hth, John