in reply to Re: Perl 5.34 is released
in thread Perl 5.34 is released

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

Replies are listed 'Best First'.
Re^3: Perl 5.34 is released
by ikegami (Patriarch) on May 24, 2021 at 17:34 UTC

    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