The apprentice, noting his name taken in vain, hazards this reply...

A qualified yes...

As with Perl itself, doesn't the real answer depend on the specific context? We saw three (or four, depending on who's counting) different ways to tackle the problem. I admit, your approach best fit the actual context. I can imagine other contexts where the other approaches might offer advantages.

Certainly it makes sense to use a module's error handling facilities when possible. However, my work with the Windows API (yes, I know it sucks, but there you are.) suggests that there are times when a selective use of a library's features can provide more than the original designer thought could (or should) be made made available (or documented).

That suggests, of course, a certain level of familiarity of said API...and a certain level of mastery over the implementation. Not to mention (something us Win folk are still amazed at), access to source (or, as is more common for us, access to definitions via header files).

In turn, it suggests that unless you feel confident that you have said familiarity, you should defer to the module's author, as that's really the whole point of modules. Isn't it? Follow another, more experienced person's footsteps to benefit from their experience, knowlege, and agony?

And, should you choose to break the rules *or* do something really tricky, please, please, oh *PLEASE* document it in comments so lesser mortals can see (and follow) your wisdom...

--f

P.S. Sorry...that's a sore spot at the moment. It'll heal; promise...


In reply to Re: Is there always MTOWTDI? by footpad
in thread Is there always MTOWTDI? by PsychoSpunk

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.