I'm having a problem with some of the modules I find on CPAN lately, and wondering if others have the same issues.

It seems a lot of authors write one big module that do too much rather than a few modules in distinct useful parts.

Two examples (nothing personal toward any authors of modules below):

  1. CGI::FormBuilder looks like a great package, but I would really like to separate the form (HTML and JavaScript) generation code from the validation code and session management code. I would like to use a completely different take on session management (using cookies and saving state on the server, not in form values), and would like to use specialized functions rather than regular expressions to validate form fields.
  2. DBIx::SearchBuilder also looks useful (as someone pointed out to me in a recent post), but I need to separate the SQL-building function from the query-executing function, and absolutely do not want anything to do with recordsets since I need the database handle to do many other things and don't want the burden of multiple database connections for a script.

I'm sure there are many other examples.

Again, not to single out specific modules or authors. It's just that sometimes a module does so much that it makes more sense to write your own (oft criticized by some as misguided) than to accept severe limitations imposed by a module or to spend the time modifying another's code to work in distinct parts.

I suspect that's why there are a lot of modules that do similar things on CPAN. In a way, the diversity is very good. In another way, it's aggrevating to see that there are 47 modules that do something similar to what you need but never quite right.

I suspect that encouraging authors to break up their modules into distinct and more generalized pieces would help the situation.

So I'd like to open up a discussion on how other programmers deal with this issue...


In reply to The temptation to roll your own module than use an existing one.... by rrwo

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.