dynamically loading perl modules

S

stig

Hi.

We are starting to build a small web portal in perl.
Already at this stage we see the need to be able to plug-in certain functionality.


strategy 1
We have thought about a solution where we can put modules in a special directory.
When the portal looks in that directory and find new modules it reads some information in via an API
that each of the modules contains (eg: getName(), getVersion() ) and presents the modules on the web portal.

strategy 2
We have also though about a solution where we enable and disable modules based on information
stored separately (in a database). This would be less dynamic but perhaps better for other reasons?


The questions i have are:
1. Is the first strategy good at all, or should we aim for the second?
2. How can we dynamically load a module?
3. Are there ways to ask a module which functions/methods it provides?
4. Should i stop developing this in perl, and look for something else?

thanks
stig
 
M

Marc Espie

You might wish to look at how existing perl frameworks do it.

For instance, Catalyst has some very extensive plugin support...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top