in reply to Exiting script from subs
Personally, I prefer to use exit() myself. Most of my work tends to be on web applications, and when you're dealing with the world at large, I've found they don't always do what you want them to. So I usually have a specific termination function in most scripts, the goal of which is to make sure all things are closed down that should be, and to NICELY give the end user an information page on why they shouldn't have done what they did. (Most people whose code I've seen that are fond of die() leave the user with a single line of text in an empty window - often with an error message that they don't understand). But that's just me, and web programming. :-)