Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
If your code is going to die or emit a warning, it’s nice if it can give you as much information as possible about what is going on at the time of the failure. One of the most valuable pieces of information is the call stack. Unfortunately, Perl’s built-in die and warn functions don’t provide that information.
Here’s a series of subroutines that call randomly_fail, and some of them call each other. When you run this program, you don’t know where it will fail.