in reply to How do I get a post mortem stack trace?

If you're happy to add to the source then you could add a __DIE__ handler e.g
$SIG{__DIE__} = sub { warn "ack: ", join(', ', grep defined, caller(0)), $/; }; die("I died at line: ", __LINE__); __output__ ack: main, -, 5, main::__ANON__, 1, 0, 0, I died at line: 5 at - line 5.
So you should get nice carp type details without the Carp.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: How do I get a post mortem stack trace?
by jsegal (Friar) on Nov 11, 2002 at 18:47 UTC
    Or to take this a step further, place the following at the beginning of the script....
    use Carp; $SIG{__DIE__} = \&Carp::confess;
    This turns any die into a confess, giving you a full stack trace. (Of course it does add two to the line numbers reported -- you could fudge this by adding these two statements to a pre-existing line).
    Enjoy...

    --JAS