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

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

Thread Previous | Thread Next
David Nicol
October 25, 2011 15:42
Re: Are exceptions "still broken" in core Perl?
Message ID:
On Tue, Oct 25, 2011 at 9:39 AM, Zefram <> 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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About