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

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



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.