For something so small and simple, what is your opinion over which is better - extending the base to be inheritable by various sub-classes (Pg, MySQL, Oracle, etc) or just copy-n-paste the code, given how simple and unlikely it is to change.

To start with, I would contact the author of Class::DBI::AbstractSearch and ask him if he is interested in making it inheritable as you describe. If he is, then you have your answer. It is certainly the better way to go about it. As for cut-n-paste, no matter how unlikely it is something will change, Murphy's law dictates that it will.

A secondary question: Is this worthy of CPAN, or should I just save it for my own toolbox (or just post it to the catacombs)?

I think my answer to the first question sort of answers this, but I would just like to add, that if it is useful to you, then it is likely useful to others, so upload it to CPAN. But hey, thats just me, others may feel CPAN is more "Sacred" than that.

-stvn

In reply to Re: Inherit or copy-n-paste? by stvn
in thread Inherit or copy-n-paste? by dcvr69

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.