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

前端 未结 6 1911
迷失自我
迷失自我 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条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 12:51

    If nothing else, Try::Tiny is still nice syntactic sugar. If you want something a little more heavyweight, there's also TryCatch, which solves some issues related to the fact that the clauses in Try::Tiny are subroutines (for instance, that return doesn't leave the enclosing function).

提交回复
热议问题