develooper Front page | perl.perl5.porters | Postings from October 2011

Re: Are exceptions "still broken" in core Perl?

Thread Previous
From:
Stevan Little
Date:
October 25, 2011 07:23
Subject:
Re: Are exceptions "still broken" in core Perl?
Message ID:
FA259A89-0EC7-421D-BC05-1EE3C7D056A3@iinteractive.com

On Oct 25, 2011, at 10:10 AM, Zefram wrote:

> Tom Christiansen wrote:
>> That module's manpage alleges:
>> 
>>   There a number of issues with "eval".
>>     * Clobbering $@
> 
> That's fixed in 5.14.
> 
>>     * Localizing $@ silently masks errors
> 
> If I understand what it's referring to, that's also fixed in 5.14.
> 
>>     * $@ might not be a true value
> 
> That still exists.
> 
>> core's eval still considered too broken to use?
> 
> Don't think we ever considered it too broken to use.  It still has some
> awkward semantics, and sugar like Try::Tiny can still be more convenient
> to use.  There's more to Try::Tiny than just working around near-bugs.

I totally agree with this statement, Try::Tiny is not simply for bug workarounds, it is also about cleaner exception handling constructs. The fact the bugs have gone away is awesome, but it most certainly does not obsolete Try::Tiny (we would need to add try/catch into the core to do that).

- Stevan


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About