On Thu, Aug 10, 2000 at 07:30:53PM -0700, Peter Scott wrote:
> So I'm thinking:
>
> eval { ...
> } catch Exception::Foo {
> ...
> } catch Exception::Bar, Exception::Baz {
> ...
> } catch {
> ... # everything else, but if this block is absent, uncaught exceptions
> # head up the call stack
> } continue {
> ... # Executed after everything
> }
I maybe warming to this idea.
> If we're really talking about new keywords, we wouldn't need a ; at the end
> of the last block; it's only needed at the moment because eval is a
> function, not a keyword. I would vote for the keywords only because people
> are going to forget the ; otherwise.
That maybe a reason to use `try' instead of `eval'. Another difference would
be that try will rethrow uncaught error, eval does not. And of course
a die in any catch block would throw an error to a try/eval block up the
stack, after running the continue block. So a die; in the catch
block would rethrow the same error.
> I like reusing 'continue' since I use 'finally' blocks about as often as I
> use 'continue' blocks anyway :-)
Right.
Graham.