Is Try::Tiny still recommended for exception handling in Perl 5.14 or later?

前端 未结 6 1900
迷失自我
迷失自我 2020-12-07 12:11

The consensus of the Perl community seems to be that Try::Tiny is the preferred way to handle exceptions.

Perl 5.14 (which is the version I use) seems to solve the

6条回答
  •  萌比男神i
    2020-12-07 12:47

    Either do:

    local $@;
    eval { … }
    

    … to prevent changes to $@ from affecting global scope, or use Try::Tiny.

    Syntactically, there are situations where I prefer one or the other.

提交回复
热议问题