||The Perl debuger is a wonderful tool. By setting its warnlevel or dielevel you can get it to print out a stack trace on a warn or a die. But what if you want to breakpoint on those events? This snippet (when put into a ./.perldb or ~/.perldb file) allows you to set breakpoints (after printing the warn/dielevel stack traces, if any) on these events. Just type sow to stop on warn, or sod to stop on die.
update: made it pass args to oldWarn/oldDie