Hi there,
I wrote a little plugin manager module which should be usable for
more or less any kind of application.
The goal was to do provide a standarized interface to create an
application (script/daemon/etc.) with support of plugging in
modules.
The most similar module I know is Module::Pluggable. However,
I think the two satisfy different needs, and the approach is
somehow different in my view, as Module::Pluggable concentrates
on bringing some modules together, whereas my module is written
from the point of view of somebody splitting an application into
modules. Because of this, I think that extending or changing
Module::Pluggable would not be the "right way", as it is
something complete and good - and my module is "different enough".
You will fild an example of how to use the module afterwards;
apart from the shown features, it supports the following
features:
* Automatically loading all modules in a given path
* modules in different hierarchy levels
* unloading of modules
* module dependencies
* debugging messages using a self-definded function (to be done)
* contrib (written in form of an module):
- event manager
- perhaps some logging module which creates a standarized
interface to log to files, syslog (via Sys::Syslog or
Unix::Syslog) and STDOUT/ERR...
Greetings from Regensburg, Germany
Baltasar
------------------ example
SYNOPSIS
### the module
package Modularizer::Module::Test;
use base qw(Modularizer::Module);
sub say_hello {
print "Hello, dear user!";
};
### the application
package main;
use Modularizer;
my $modul = instance Modularizer;
#$modul->module_directory('modules/');
#$modul->module_extension('.mom');
$modul->module('Test')->say_hello();
exit;