I have a fairly large codebase which needs to be deployed in a variety of situations/environments. Given the nature of the code, it can have an excessive number of module requirements to cover all the scenarios it can be leveraged for. Instead of doing some type of preinspection of the available modules and then reconfiguring the codebase on the fly or trying to download modules from CPAN, I wanted to wait until runtime and let user configurable data drive what modules should be loaded.
While you can do what you're trying to do, that way will generally lead to insanity. It is much much saner to manage dependencies at the time the dependency is now needed. This generally comes down to two places:
- Upon installation or deployment
- When a new feature is enabled
In the case of the second, I would have both a config file and a UI. If the user directly edits the config file, they are responsible for the dependencies (superuser mode). If the UI is used, then whatever code backs the UI should make sure the dependency is met, either by alerting the user to tell the sysadmin or (preferable) installing the dependency itself.
Before you say "But you need root!", I say you don't. Check out Perl::Install for an easy way to install Perl anywhere you want. This is what I do when I have an application - it literally has its own Perl installation along with its own modules. That way, I know exactly what user permissions are required to update the install.
Before you complain about space, remember that disk space is much much cheaper than people time.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.