in reply to Re: Do the Monks recommend Try::Tiny for eval work?
in thread Do the Monks recommend Try::Tiny for eval work?

Devel::EvalError isn't really needed with a modern version of Perl (where a DESTROY can't clobber $@).

At work I mostly inherited the following pattern:

eval { ... 1 } or do { my $e = $@ || 'Unknown error'; ... };

And I've been pretty happy with it.

We are still on a Perl version where $@ can be clobbered by a DESTROY, but we just exhaustively fix any DESTROY methods.

If you have less control over your code base(s) and have to deal with less modern versions of Perl, then Devel::EvalError might be very useful (it was very useful to me at a prior job).

- tye