What's broken about exceptions in Perl?

前端 未结 8 1162
孤城傲影
孤城傲影 2020-11-30 05:43

A discussion in another question got me wondering: what do other programming languages\' exception systems have that Perl\'s lacks?

Perl\'s built-in exceptions are a

8条回答
  •  失恋的感觉
    2020-11-30 06:23

    In C++ and C#, you can define types that can be thrown, with separate catch blocks that manage each type. Perl type systems have certain niggling issues related to RTTI and inheritance, according from what I read on chomatic's blog.

    I'm not sure how other dynamic languages manage exceptions; both C++ and C# are static languages and that bears with it a certain power in the type system.

    The philosophical problem is that Perl 5 exceptions are bolted on; they aren't built from the start of the language design as something integral to how Perl is written.

提交回复
热议问题