Salvage bits and pieces from the experimental 'utf8 everywhere'
[p5sagit/p5-mst-13.2.git] / lib / Carp / Heavy.pm
index 36bdcd4..a3d951b 100644 (file)
@@ -1,8 +1,18 @@
+# Carp::Heavy uses some variables in common with Carp.
 package Carp;
 
-our $MaxEvalLen;
-our $MaxLenArg;
-our $Verbose;
+=head1 NAME
+
+Carp heavy machinery - no user serviceable parts inside
+
+=cut
+
+# use strict; # not yet
+
+# On one line so MakeMaker will see it.
+use Carp;  our $VERSION = $Carp::VERSION;
+
+our ($CarpLevel, $MaxArgNums, $MaxEvalLen, $MaxLenArg, $Verbose);
 
 sub caller_info {
   my $i = shift(@_) + 1;
@@ -38,7 +48,7 @@ sub format_arg {
     $arg = 'undef';
   }
   elsif (ref($arg)) {
-    $arg .= ''; # Make it a string;
+      $arg = defined($overload::VERSION) ? overload::StrVal($arg) : "$arg";
   }
   $arg =~ s/'/\\'/g;
   $arg = str_len_trim($arg, $MaxLenArg);