greetings brothers and sisters,

upon my path I have largely been using Perl for CGI work. This is not uncommon, and I learned long ago that CGI.pm is your best friend. There has always been something that has troubled me, though, and it recently came to light again when reading up on CGI::Application.

For me, these modules try to do too much.


Let me explain my blasphemy against CGI.pm before I'm branded a heretic. And I'll note that I do still use it, even if I'm a bit unhappy with it. For me, I am quite enamored with CGI.pm's ability to parse out all the input my script could ever want. But I have absolutely no use for it's HTML generation facilities.

I imagine it was around long before the tools I use now, but I much prefer using a templating system (namely Template Toolkit) for my document generation. How I've longed to cleave CGI.pm in two, leaving by the wayside the html generation and holding onto it's wonderful parsing abilities.

The problem also arose when I learned that CGI::Application is tied internally to HTML::Template. A worthy module to be sure, I have already mentioned that I prefer the Template Toolkit, as my applications output more than just web pages.

While it is possible to override this relationship I am wondering:

  1. what unused overhead I'm stuck with by discarding this feature in preference of something extra i must implement, and
  2. why CGI::Application chose to get in bed with one of a myriad of templating modules, when some of the very first words in the documentation state that it is intended to avoid binding a developer to any particular tools.

I think i personally would have been happiest if CGI::Application hadn't strayed from the goals of being a solid application framework module.

My questions to the perlmonks community is what do you consider when defining the scope/granularity of your own modules? What does the perl community at large have to say about such things? Have any of you had similar experiences with popular modules that for you seemed a bit bloated in the light of your own projects?


In reply to Modules that do Less by AidanLee

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.