Esteemed Monken,

I come asking for your wisdom, as Super Search has failed me (or maybe I failed it?). Context, this is work-related.

We have a bunch of scripts that create reports from our database, reports of various shapes and sizes. But the more we work on these scripts (generation, we call them), we can't help but realize they all start out very similarly (strict, warnings, GetOpt, option processing...). Some reports ask for params A, B, C, others ask for A, B, D, and yet others ask for A, D, E (and so on).

We were wondering if anyone had any experience with (or could point us to an existing thread/resource/discussion about) modularizing scripts that are similar, yet still different enough.

We already have a set of specialized modules that handles all of the DB and utility/validation stuff, so would this be another one of those in-house modules? NameSpace::Report?

Many thanks, and much Perl.

-deep

PS - Apologies if I wasn't clear enough. Also, please feel free to change the title, I don't know how to make it any more explanatory/searchable...


In reply to Generalizing Similar Scripts into a Module by deep submerge

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.