

convert source:

    try {
        #TRY_BLOCK#
    }
    catch (MyClass $e) {
        #CATCH[1]#
    }
    catch {
        #CATCH[2]#
    }
    finally {
        #FINALLY#
    }

to:

    {
        my $statement = bless { finally => $FINALLY }, "...";

        my $result = eval {
            $statement->{block_finished} = 0;
            {
                #TRY_BLOCK#
            }
            $statement->{block_finished} = 1;
        };
        undef $statement->{return} if not $statement->{return_not_called};

        my $err = $@;
        foreach $catch (...all_catch_blocks...) {
            if () {
                next;
            }
        }

        if ($statement->{return}) {
            return @{ $statement->{return} }; # in correct context
        }
    }
