From: Tony Bowden Date: Sun, 24 Jun 2001 17:32:40 +0000 (+0100) Subject: (Replaced by #10922) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f43adeb59ad0b6b1b88cac94966f40d736797192;p=p5sagit%2Fp5-mst-13.2.git (Replaced by #10922) Subject: Re: [PATCH] Re: [ID 20010624.001] debugger T, and Carp::carp don't trace arg of Message-ID: <20010624173240.A16293@blackstar.co.uk> Document (well, mention) shortmess() and longmess() to rob people of their fun of reinventing the wheel. p4raw-id: //depot/perl@10899 --- diff --git a/lib/Carp.pm b/lib/Carp.pm index 69d477b..76a6846 100644 --- a/lib/Carp.pm +++ b/lib/Carp.pm @@ -51,6 +51,11 @@ The Carp routines don't handle exception objects currently. If called with a first argument that is a reference, they simply call die() or warn(), as appropriate. +However, rather than duplicating this effort in your own exception +object, you can access the caller information that croak() would supply +as shortmess(), and the full stack trace that confess() would generate +as longmess() (Neither of these are exported by default.) + =cut # This package is heavily used. Be small. Be fast. Be good. @@ -75,7 +80,7 @@ $CarpInternal{Carp}++; require Exporter; @ISA = ('Exporter'); @EXPORT = qw(confess croak carp); -@EXPORT_OK = qw(cluck verbose); +@EXPORT_OK = qw(cluck verbose longmess shortmess); @EXPORT_FAIL = qw(verbose); # hook to enable verbose mode