i'm happy to see anyone working on this kind of stuff. i've played around with the exception handling modules on CPAN and recently ended up writing my own which is very similar to what you have but is more focused on being a layered error handling system similar to what is found in large dbms's. (not clean enough to show off yet though)

i'm not really sure that this or any of the ones in CPAN really offer anything more than syntactic sugar over the regular eval/die technique. what i'd really like to see is a pragma or something that gives us the real powerful part of java's exception handling: compile-time checking. for those who aren't familiar with how it works in java, if any code in the try block can possibly throw an exception, the compiler forces you to put an appropriate catch() in place. it gets to be a pain sometimes when you use a class method that potentially throws lots of exceptions because you have to explicitly catch them all, but it does a good job of keeping runtime errors out of your program.

anders pearson


In reply to Re: Exception handling (alternatives) by thraxil
in thread Exception handling (alternatives) by vladb

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.