On 6 June 2010 15:53, Peter Gordon <[email protected]> wrote:

> I have a trivial program shown below. In order to better debug an
> application I would like to be able to obtain a stack trace.


To get a formatted one, a la Carp::confess, as a string:

    my $stacktrace = Carp::longmess();

To make Carp::croak behave like Carp::confess:

    perl -MCarp=verbose ...

To make every $SIG{__DIE__} become a Carp::confess:

    perl -MCarp::Always ...

Finally, to get an more useful stacktrace (that you can both format and
inspect programatically), look at Devel::StackTrace.
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to