I don't put things into CPAN, but I prefer the following:
  1. Never let a module kill the caller. Instead, return undef to indicate error, and, if it seems like it might be needed, provide another method that returns a descriptive error string. This adds to the bulk of the code, but I think it's worth it. I could be wrong.
  2. Offload input taint checking to the calling application; within the module's methods, sanity check only. Some methods will be more robust if they do slightly more extensive testing of input data; a flexible solution is to provide testing methods outside of your setter/getter methods. This allows the user to work it: "If the input is okay, then set it in the module." Later, if you just can't stand the risk that some user is going to hose the thing with unchecked data, you can add the call to the testing method to the setting method.
  3. I prefer combined setter/getter methods if both actions are simple. Otherwise, I prefer set_foo() and get_foo()
  4. Regarding constructor vs. "lots of methods", I prefer to let users of my modules work in whatever way suits them best, so I generally try to support sensible defaults, overridden by any arguments to the constructor, and setter methods accessible to the user. The defaults and overrides actually call the setter methods to ensure consistency and stick more closely to the OOP.

    I try to avoid forcing my will on users... TMTOWTDI and my way is usually just plain dumb.

In reply to Re: Thoughts On Object-Oriented Module Design. Input Sought. by gloryhack
in thread Thoughts On Object-Oriented Module Design. Input Sought. by ajt

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.