On Mon, 30 Apr 2001, Jeffrey W. Baker wrote:
> Yes precisely. It used to be that you could only die() with a string, but
> 5.<mumble> gave us die() with a reference to an object and at that moment
> the system was complete. The creation of a rational exception object type
> is left to the discretion of the system designer (thankfully).
Well actually I personally would prefer proper exception semantics, but
unless someone re-writes Error.pm (or whatever) to be implemented using
Filter, then we're stuck with closures, which I'll avoid thank you.
The things I don't like are:
You currently have to do two blocks, one if ($@), and then
if($@->isa(...)) inside that. That's too much typing, when Perl is so
renouned for it's succinctness (is that a word?).
The second thing is no finalize/always clause (you can sort of emulate it,
but it's not quite guaranteed like it is in languages that implement it
properly - we discussed this yonks ago on perl-friends, I'll try and dig
up the discussion if you want).
The whole $@->isa() thing, it's just plain ugly, and doesn't really look
like exception handling - it looks like botched up OO code. It can/should
be more structured IMHO.
It's also another case of far too many ways to do it, causing people's
perl code to look different everywhere, which is bad for maintainence.
--
<Matt/>
/|| ** Founder and CTO ** ** http://axkit.com/ **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** mod_perl news and resources: http://take23.org **
\\//
//\\
// \\