Salvage bits and pieces from the experimental 'utf8 everywhere'
[p5sagit/p5-mst-13.2.git] / lib / Carp.pm
index eaa4d53..69d477b 100644 (file)
@@ -1,5 +1,7 @@
 package Carp;
 
+our $VERSION = '1.00';
+
 =head1 NAME
 
 carp    - warn of errors (from perspective of caller)
@@ -68,6 +70,8 @@ $MaxArgLen = 64;        # How much of each argument to print. 0 = all.
 $MaxArgNums = 8;        # How many arguments to print. 0 = all.
 $Verbose = 0;          # If true then make shortmess call longmess instead
 
+$CarpInternal{Carp}++;
+
 require Exporter;
 @ISA = ('Exporter');
 @EXPORT = qw(confess croak carp);
@@ -94,7 +98,7 @@ sub export_fail {
 # each function call on the stack.
 
 sub longmess {
-    require Carp::Heavy;
+    { local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
     goto &longmess_heavy;
 }
 
@@ -106,7 +110,7 @@ sub longmess {
 # you always get a stack trace
 
 sub shortmess {        # Short-circuit &longmess if called via multiple packages
-    require Carp::Heavy;
+    { local $@; require Carp::Heavy; } # XXX fix require to not clear $@?
     goto &shortmess_heavy;
 }