The API changes I've made are deliberate, and ultimately for the good of the project. As an example of why I made these changes, there was a method that would:

  1. return 0; if certain arguments are invalid, croak()s if others are invalid,
  2. carp "Connection failed"; return 0; on connection failures. Yes, carp(), and
  3. Not trap upstream exceptions itself, so it would die for any number of undocumented reasons the author did not anticipate (and no unit tests either!)

Since returning non-zero had no semantic meaning beyond "nothing broke," and the distinction between return 0; v. croak() was already ill-defined, I changed this sub to always croak() on error, thinking most implementations would already be eval{...}-ing that call, or risk premature death.

That's the biggest change. The other 3-4 examples are similar but simpler (fewer cases).

The documentation for the methods was generally good, except when it came to error handling. So I'm not really even going against the existing documentation, here, though I'm not using that as an excuse to break people's code. :-)

BTW, I think it's ok if you name the module, that might help, it's all open source anyway :-)

My personal choice. I'm not naming the module out of respect for the original author. I have not been able to reach them, and don't want them to hear about my feedback via this thread. I trust I've described the differences well enough for the general advice I'm asking for. (If not, please let me know!)


In reply to Re^2: Minor API changes in 10-year-old module by wanna_code_perl
in thread Minor API changes in 10-year-old module by wanna_code_perl

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.