This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: More verbose POD for Carp
authorBen Tilly <ben_tilly@operamail.com>
Sun, 2 Dec 2001 11:32:51 +0000 (06:32 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 2 Dec 2001 16:55:21 +0000 (16:55 +0000)
Message-ID: <3C0A9748@operamail.com>

p4raw-id: //depot/perl@13426

lib/Carp.pm

index 84508b2..5dbae29 100644 (file)
@@ -155,7 +155,15 @@ sub export_fail {
 
 sub longmess {
     { local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
-    goto &longmess_heavy;
+    # Icky backwards compatibility wrapper. :-(
+    my $call_pack = caller();
+    if ($Internal{$call_pack} or $CarpInternal{$call_pack}) {
+      return longmess_heavy(@_);
+    }
+    else {
+      local $CarpLevel = $CarpLevel + 1;
+      return longmess_heavy(@_);
+    }
 }
 
 
@@ -167,7 +175,10 @@ sub longmess {
 
 sub shortmess {        # Short-circuit &longmess if called via multiple packages
     { local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
-    goto &shortmess_heavy;
+    # Icky backwards compatibility wrapper. :-(
+    my $call_pack = caller();
+    local @CARP_NOT = caller();
+    shortmess_heavy(@_);
 }