Nice.

The continue clause, I assume would re-raise an uncaught exception.
But, a big but. How does the 'else' clause indicate that the exception
was handled?

A couple of possiblities

1. Undef $@. But that's a bit of extra work in each leg.

2. switch is 'slightly' special in an eval/else block. If the case
   selects the error, then it is considered handled unless a die or
   redo is encountered.

3. If continue is not being used by Damian's switch, then a continue
   continues onto the continue block, and marks the successful handling
   of the exception.

<chaim>

>>>>> "GB" == Graham Barr <[EMAIL PROTECTED]> writes:

GB> I was more thinking of

GB>     eval {
GB>             # fragile code
GB>     }
GB>         else {                      # catch ALL exceptions
GB>         switch ($@) {
GB>             case __->isa('IO')     { ... }
GB>             case __->isa('Socket') { ... }
GB>                 else                   { ... }
GB>         }
GB>     }
GB>         continue {
GB>            # code always executed (ie finally)
GB>         }

GB> And the only new keywords are for the switch statement.

-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183

Reply via email to