Also, checkout Graham Barr's Error.pm for an OO styled "try, throw, catch"
model. Really nice for a complete OO Perl design, IMHO.
--Jeff
The one
I use is a customized version but it's basically the OO "try, throw,
catch" model that I've seen in other languages.
On Sat, 8 Apr 2000, Autarch wrote:
> N; charset=US-ASCII
> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N
> Status: U
>
> On Sat, 8 Apr 2000, Matt Sergeant wrote:
>
> > I've written a short document on exception handling for the guide, even
> > though it's not particularly mod_perl specific, Stas thinks it would be a
> > good addition. Take a look at it, and let me know if there is anything you
> > would change before it's added:
> >
> > http://modperl.sergeant.org/guide/exceptions.html
>
> This is a good tutorial. You might want to take a look at some exception
> code I wrote (ftp://ftp.urth.org/pub/, grab the Exception and StackTrace
> tar balls) that lets you declare all your exception types via 'use'
> statements. I think its a bit cleaner than the AUTOLOAD method you
> propose as it can catch typos later on. Plus it lets you create actual
> class hierarchies for your exceptions, which could be nice if you want to
> create exception classes that do more stuff and then inherit from them.
>
>
> -dave 0