in reply to is Carp::longmess deprecated?

I haven't needed to capture stacktrace information (as opposed to outputting it from confess or, rarely, cluck) for some years but I recall I generated custom stacktrace messages with caller.

Looking at the 5.12.2 source code (http://cpansearch.perl.org/src/JESSE/perl-5.12.2/lib/Carp.pm), croak and confess are implemented via longmess (with carp and cluck via shortmess):

sub croak { die shortmess @_ } sub confess { die longmess @_ } sub carp { warn shortmess @_ } sub cluck { warn longmess @_ }

There appears to be no change to that in the latest 5.13.7 development source (http://cpansearch.perl.org/src/BINGOS/perl-5.13.7/lib/Carp.pm), so no indication of deprecation at this point in time.

Maybe someone with insider information can provide a more definite answer.

-- Ken

Replies are listed 'Best First'.
Re^2: is Carp::longmess deprecated?
by kgoess (Beadle) on Nov 29, 2010 at 20:02 UTC
    I recall I generated custom stacktrace messages with caller.
    Yeah, I could do a loop around caller() too, but it seems a shame to if there's a core module that already does the same thing.

      I agree with not reinventing the wheel. My reference to caller() was really just in response to your question about what other people were using. I can't remember the details but do recall I needed the information in some sort of custom format and caller() was quite appropriate for that. If I wanted to capture the same information that is output by confess(), I would probably use longmess().

      -- Ken