Chaim Frenkel wrote:
> 
> Tony Olekshy wrote:
> 
> > If no exception is in scope Perl should continue to generate and
> > propagate exceptions (die and $@) as it does now, so we don't
> > break tradition.
> 
> No, that should be the difference between die and throw. Die is
> immediately fatal. (i.e. current semantics) throw is new and does
> the magic.
> 
> We get no breakage that way.

But if die and eval are supposed to do keep doing what they do now,
RFC 88 doesn't impact them at all.  In fact it depends on what they
do now.  To quote from RFC 88:

    Although the following code using the new mechanism:

        try { may_throw_1 }
        catch may_throw_2 => { may_throw_3 }
        finally { may_throw_4 }

    can be written in Perl 5 like this:

        eval { may_throw_1 };
        my $exception = $@;
        if ($exception) {
            my $test = eval { may_throw_2 };
            $@ and $exception = $@;
            if ( ! $@ and $test ) {
                eval { may_throw_3 };
                $exception = $@;
                }
            }
        eval { may_throw_4 };
        ($exception ||= $@) and die $exception;

    the opportunity for flow-control errors increases.

On the other hand, if eval is suddenly supposed to stop catching
so-called non-fatal errors, then all hades breaks loose. Trust me.

Yours, &c, Tony Olekshy

Reply via email to