[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception handling in Perl or rather: non-local goto's



Thinking about it another second, I might just need to use an eval { }
block; after all, I'm not really all that interested in the actual
error. I'm only interested in being able to clean up the loose ends
such as any open db connections.

On Mon, Jun 20, 2011 at 11:49 PM, Erik Huelsmann <..hidden..> wrote:
> Last weekend, I added non-local gotos using exception handling to
> replace 'exit;' calls.
>
> Today, mst showed up on IRC (coincidentally), telling me about an
> issue with running our code under suEXEC conditions. That bit was
> fixed in r3304, but as he did some code review, he pointed out my use
> of Error.pm is really 'so 2005' -- Error.pm having been superseeded by
> Try::Tiny.
>
> When reading the POD for Try::Tiny, I get extremely unhappy about its
> treatment of the $@ variable. However, possibly, that doesn't matter
> much for our specific purpose.
>
> So, the question becomes: Should I replace Error.pm (which supposedly
> is "completely broken" -- it seemed to work for my purpose?) with
> Try::Tiny or is there an even better way to achieve the non-local
> gotos? (I'm basically using it as a setjmp/longjmp combo).
>
>
> Bye,
>
> Erik.
>