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

Ari has asked for the wisdom of the Perl Monks concerning the following question:

How much error handling should you build in? For example, I have a very simple program that takes one sort of ID and converts it to another in about 15 separate stages. Should I build in error handling at each stage (similar to below) or only at the places where it's highly likely to fail after bad data?

else { print STDERR; die ("Unable to proceed. ID may be invalid. Exiting.\n");

(Initial input and the first calculations at the main concern - after that, there's almost no chance of error.)

I don't want to overdo it, same as I don't want to overcomment, but I also don't want to leave later maintainers wondering why it wasn't set up properly to start with!