in reply to Perl 5.34 is released

I'll be damned... try/catch! Yay!

Replies are listed 'Best First'.
Re^2: Perl 5.34 is released
by kcott (Archbishop) on May 22, 2021 at 09:20 UTC

    G'day stevieb,

    You may already know what follows. This information is for those who don't.

    The try/catch feature is experimental.

    Any usage should be preceded by these lines (in the order shown):

    no warnings 'experimental::try'; use feature 'try';

    Avoid all experimental features, including this one, in any production-grade code.

    See "perlsyn: Try Catch Exception Handling" for more details.

    — Ken

      Simpler:

      use experimental qw( try );

      Seeking work! You can reach me at ikegami@adaelis.com

        I may not have been aware of the experimental pragma — not overly surprising as I avoid experimental features — so thanks for the information.

        The experimental documentation (for v5.34) lists supported features: try is not among them. However, it does appear to work: no "Can't enable unknown feature try ..." error, and try/catch functions as expected. It looks like the documentation needs an update.

        — Ken