I agree that Perl 5's exception system is somewhat clumsy, and makes it hard to filter by exception type.

On the other hand, in my mostly small, mostly fun projects I haven't needed that feature at all - either I just hand on exceptions, or drop them, or warn and continue - so far I always left the interpretation of the error to the user, which worked pretty well for me.

That said in Perl 6 we will have something like an exception hierarchy (except that it won't be exactly tree like, because we don't just rely on inheritance but also on role composition). But the problem - as always - is that somebody needs to actually do it: define a structure, default error messages and so on, and spec that.

So please take this as a call for volunteers. If you are (like me) interested in Perl 6 having a better exception system than Perl 5 (and one that makes translations to other languages easy without breaking any code), consider contributing.

(I'm glad to help where I can, but I won't be the driving force - I have too many other Perl 6 related projects I'm working on).

Perl 6 - links to (nearly) everything that is Perl 6.

In reply to Re^2: Dealing with errors in subroutines by moritz
in thread Dealing with errors in subroutines by walkingthecow

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.