http://www.perlmonks.org?node_id=1092478


in reply to Using die() in methods

Anyway, using die() from the method really looks a bit odd.

It looks pretty normal to me.

Who really does that? Have you been always doing it that way or started to do it that way some time ago?

Lots of folks do it; it's how you're meant to handle errors, after all. Modules like autodie bring it to core functions in perl that were written before exceptions existed.

Anyway, exceptions are useful if they don't need to be always caught in the caller, but somtimes in the caller's caller, or higher up the call chain.

The second main benefit from exceptions is that if somebody forgets to handle them, it'll be very obvious. On the other hand if things go wrong and nobody notices, much more harm is done (say writing a config file fails, and thus work is silently lost, and nobody notices until much later), and it's much harder to debug.