|Think about Loose Coupling|
Nested evals - are they evil?by cLive ;-) (Parson)
|on Jul 30, 2007 at 22:34 UTC||Need Help??|
cLive ;-) has asked for the
wisdom of the Perl Monks concerning the following question:
I'm gradually taking over responsibility of a codebase that uses nested evals quite a bit. Sort of like this:
with callMethod() having another one embedded, eg
The impression I get is that some error checking is missing and this is a rough and ready way of dealing with fatal errors. It works, but for some reason, it makes me feel uncomfortable.
My instinct is telling me to get rid of these evals (while fixing exception handling), but am I just making work for myself? Or should I be embracing this exception handling technique as a tool for faster development?
edit - added bold ;-)
edit 2 - yes, the confesses were originally dies (so that explains quite a bit right there :)