It'd be really nice if one of the dozen exception modules got included in the core (besides the very old exceptions.pl, that is). I say this because one of the nice things about exceptions in other languages is that they interoperate.

I have no idea whether any of the many exception modules can deal with each others' exceptions, and that has been a big reason why I haven't invested the time in any of them.

Update based on John M. Dlugosz's reply: Yeah, that is all I am talking about. I suspect that one or more of those modules is well written enough that it can deal with exceptions from other modules intelligently. Perl gives us eval and die, but we need a common idiom for catch() that works with all reasonable exception modules. I'd base such a catch() around UNIVERSAL::isa() but with support for substring/regex matches on error text (since not all uses of die are going to be throwing objects).

I think there is plenty of room for more than one way of writing catch(), etc. But we need an example in the core that sets a de facto standard for interoperability among them.

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: Throwing Exceptions and Error Handling by tye
in thread Throwing Exceptions and Error Handling by John M. Dlugosz

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.