Thanks for the signal handling advice, but, yeah, I know it doesn't make any sense to exit 0 when ending the program due to an exception, that's why I posted, but you know what?! Now, I can't recreate it!?
This says that it was all probably an error in my usage/perception. I'll keep hunting for the situations in which I had thought I was getting exit values of 0 during an exception, but for the moment, I have tried 3 different situations, and none are now exiting with a value of 0! I'm glad I was mistaken, but I'm also now mystified.
OK, this follow-up to to show that my exit-0-on-exception was not a problem with Exception::Class nor die. I was getting exit values of 0 for 3 different reasons. I hunted them all down, and it was all my fault.
1. This one is embarassing. When I was testing my code, firing from the hip on the command line, you might say, I did this:
Of course, then I did echo $? I was getting the return value of tee! Doh!
2. I was using rsh on some commands. rsh does NOT return the exit value of the command it ran, but it returns 0 if it was able to run a command at all, even if that command returned non-zero. You must come up with a workaround to acquire the exit value of an rshed command.
3. This one actually involved my Perl code. In some scripts, I was using END{} subroutines, and I was not handing off the bad exit value. So the exit value of my perl progran during an exception was 0 if my last command in the END{} sub was good.