Peter Scott wrote:
> 
> David L. Nicol wrote:
> 
> >Further discussion in the thread discussed the idea of returning
> >to the point of throwing, as the routine noting the error might
> >be supposed to ignore this error, the author of this comment
> >(Bennett Todd?) implied that that is how throwing and catching
> >is supposed to work.
> 
> I disagree.  It should never be possible to ignore an exception,
> except by making it painfully obvious:
> 
> try {
>    # fragile code which doesn't call any subroutines that might die
>    # and doesn't include any other try blocks
> } catch {
>    # No code at all
> }

I agree with Peter: use a try with an empty catch.

Without these semantics, "try" isn't much use for just the cases
it is designed to handle, (especially in the case of a simple
try {} finally {}, which is a very common use).  That's why both
RFC 63 and RFC 88 do it that way.

However, in the name of not gratuitously breaking old Perl code,
and keeping Perl extensible, eval {} should continue to do what
it does now, so both cases would be covered anyway.

Yours, &c, Tony Olekshy

Reply via email to