This article shows Syntax::Keyword::Try being the fastest try/catch implementation for Perl: http://blogs.perl.org/users/diab_jerius/2017/04/how-fast-can-you-try.html It was written in 2017. I wonder if it's worth finding the current fastest try/catch implementation for Perl considering how we are widely and increasingly using try/catch blocks in Koha.
Well, this is interesting! Thanks Kyle
On https://metacpan.org/pod/Syntax::Keyword::Try, the author points out that try/catch/finally was (finally) added to Perl 5.34 (released May 20 2021) and that Feature::Compat::Try should be used for new code It looks like Perl 5.34 is used in Ubuntu from 22.04 onward. In Debian, it's in bookworm/testing. Although it looks like the "try" feature is still marked as experimental: https://perldoc.perl.org/feature#The-'try'-feature. Looks like Syntax::Keyword::Try has some issues with Perl older than 5.24 (https://metacpan.org/pod/Syntax::Keyword::Try#$@-is-not-local'ised-by-try-do-before-perl-5.24) but I don't think we support any OS that has a Perl that old. Syntax::Keyword::Try/Feature::Compat::Try sound pretty interesting.