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.

  1. 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.
  2. 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
  3. 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.
  4. 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?


In reply to Installation of various non-pm files with Module::Build by friedo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.