From: Gurusamy Sarathy Date: Mon, 15 Feb 1999 03:39:53 +0000 (+0000) Subject: allow the Carp routines to pass through exception objects X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d2fe67bec76f22b4a4066b48714199469a8288c2;p=p5sagit%2Fp5-mst-13.2.git allow the Carp routines to pass through exception objects p4raw-id: //depot/perl@2928 --- diff --git a/lib/Carp.pm b/lib/Carp.pm index c654565..f8f750a 100644 --- a/lib/Carp.pm +++ b/lib/Carp.pm @@ -43,6 +43,12 @@ This feature is enabled by 'importing' the non-existent symbol or by including the string C in the L environment variable. +=head1 BUGS + +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. + =cut # This package is heavily used. Be small. Be fast. Be good. @@ -88,6 +94,7 @@ sub export_fail { # each function call on the stack. sub longmess { + return @_ if ref $_[0]; my $error = join '', @_; my $mess = ""; my $i = 1 + $CarpLevel; @@ -190,6 +197,7 @@ sub longmess { sub shortmess { # Short-circuit &longmess if called via multiple packages goto &longmess if $Verbose; + return @_ if ref $_[0]; my $error = join '', @_; my ($prevpack) = caller(1); my $extra = $CarpLevel;