package,module or ???
Posted on 2001-06-14
My question is somewhat difficult to explain, but i'll try anyway :)
I'm working on this cgi application in Perl where an administrator can activate and deactivate certain parts of the application.
There's is a lot of different parts that can be activated or deactivated. My problem is i don't quite know how to implement this the most efficient way.
Should i write all the parts as functions in a package that would be required in the top of my cgi script? The problem with this, as I see it, is that my application would include all the code of the different parts even though they are not needed( if they are deactivated ).
Should I put all the parts in a module?
Should I put each part in it's own module?
Is it possible to somehow only include something in your code if it is needed? ie:
if( module1IsActivated) use module 1;
Or maybe i should do this in a completely different way that i haven't thought of :)
Any ideas appreciated!