Stack traces with Carp::Always
Your program just died. Great, now what?
If the exception string ended with a \n, it didn't give you a line number. But even if it did, that's often not enough to debug the problem.
Carp::Always to the rescue.
use Carp::Always;
Put this anywhere and all exceptions (and warnings) will have a full stack trace.
You probably don't want to turn this on permanently, because the stack trace will be added to exceptions even inside an 'eval BLOCK', and that's probably not what you wanted.
So since it's a temporary debugging tool, this is a pretty bad thing to forget in the code base since it changes global behaviour.
Do you know that nothing will go weird in the entire rest of your app now that exceptions will look different? No you do not. So put a reminder comment you can 'grep' for on the same line:
use Carp::Always; ### TODO: MyInitials: Remove before committing
Yes, it needs to have your initials on it, it's your personal responsibility to remove this.
If that's too scary, you can also load it on the command line with
perl -MCarp::Always script.pl prove -MCarp::Always -r t
just for that script invocation.
Remember: Carp::Always, but only some of the time.

















