Skip to content

[doc] Try/catch are no longer Experimental. Possible clarification in perlsyn #23436

Open
@lindleyw

Description

@lindleyw

Where
Perlfunc outdated; and suggestion in perlsyn to clarify how a finally block differs from code that merely follows try/catch.

Description
The documentation for try/catch/finally in perlfunc still (as of v5.42.0) refer to "the experimental try feature". It is no longer experimental.

Also: In perlsyn, where it states:

The finally block is equivalent to using a defer block and will be invoked in the same situations; whether the try block completes successfully, throws an exception, or transfers control elsewhere by using return, a loop control, or goto.

perhaps more bluntly clarify why one might use a finally block, perhaps as:

The finally block is equivalent to using a defer block and will be invoked in the same situations: not only when the try block completes successfully or throws an exception, but also (out of the ordinary order of execution) immediately before code in the try or catch blocks transfers control elsewhere by using return, a loop control, or goto.

(also note that a colon, not a semicolon, is appropriate after "situations" to introduce a list.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions