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

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

Thread Previous | Thread Next
From:
David Nicol
Date:
October 25, 2011 15:42
Subject:
Re: Are exceptions "still broken" in core Perl?
Message ID:
CAFwScO9ZHHHJW9De8J=vk_jTSyFbUeRFqrX4Z+s8gBfZerDUXg@mail.gmail.com
On Tue, Oct 25, 2011 at 9:39 AM, Zefram <zefram@fysh.org> wrote:

>  I think the best
> available approach is



I like the practice of separating the questions
"did the block succeed?" from "what was the exception?"
by ending the eval block with 1 instead of testing $@.

unless(eval { ... ; 1}){

        ... #catch
}



-- 
"*Unacceptable:* Little cartoon boy micturating on Fedora logo" -- fedora
project trademark
guidelines<http://fedoraproject.org/wiki/Legal:Trademark_guidelines>

Thread Previous | Thread Next


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