http://qs321.pair.com?node_id=379099


in reply to Re^3: Automatic stack traces for warns and dies
in thread Automatic stack traces for warns and dies

The first example is probably OK as long as your check against $@ is both strict enough and liberal enough to not be confused by the stack trace. The second example has a bigger problem, eval {foo} works but foo() on it's own doesn't give a stack trace.

The solution is not a one-liner, it needs to pay attention to $^S which indicates whether we're being eval()ed or not. It should also play well with other die/warn handlers. diagnostics does this. I'll submitting a small patch to add stack traces to warns and to allow a mode that turns off the verbose explanations, then I'll be happy.