summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-02-15 03:39:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-02-15 03:39:53 +0000
commitd2fe67bec76f22b4a4066b48714199469a8288c2 (patch)
treed91b63133913e73cdf06dfe683f4239b28c6898c
parent1a91aff4866a96b265856141bcd4ee58b868fcc8 (diff)
downloadperl-d2fe67bec76f22b4a4066b48714199469a8288c2.tar.gz
allow the Carp routines to pass through exception objects
p4raw-id: //depot/perl@2928
-rw-r--r--lib/Carp.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index c6545650ef..f8f750a5d7 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<MCarp=verbose> in the L<PERL5OPT>
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;