I've got a CGI::Application-based web-app and I currently use Module::Build to install it. That works fine for the application code itself (the *.pm modules) but, with a web-app, there's always all sorts of other files: templates, a CSS file, a couple Javascript files, and the CGI script itself which instantiates the module.
These need to be installed in various directories; the CGI script in a CGI-executable directory, the JS and CSS files in another web directory (depending on the user's configuration), the template files somewhere else, etc. I've been pondering a few solutions to this, but I keep going around in circles.
- Just install everything in the same place the .pm files go, and write some runmodes to load and spit out the .css and .js files.
- Very easy and simple
- But very inefficient in a pure CGI environment
- Makes it hard for users to modify the templates or CSS.
- Override some method in Module::Build to prompt the user for their web, template and CGI directories, and install the stuff there.
- Slightly less easy and simple
- But it's much more efficient to have static files instead of file-spitting CGI code
- Relies on the user being less dumb
- Makes it easier for users to modify the templates and CSS
- Distribute the templates, CSS and JS separately from the modules.
- Allows the user to put the stuff wherever they want, independant of the module building process
- But the module distribution itself is non-functional without the other parts.
- There's also complete all-in-one systems like that used by Krang, but I think that's definitely overkill for my purposes.
Have any of you dealt with this issue before? How did you handle it?
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.