This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Examining objects through the 'x' command in the perl debugger doesn't
[perl5.git] / lib / dumpvar.pl
index d02ebb9..1c782dd 100644 (file)
@@ -165,8 +165,7 @@ sub unwrap {
       # Match type and address.                      
       # Unblessed references will look like TYPE(0x...)
       # Blessed references will look like Class=TYPE(0x...)
-      ($start_part, $val) = split /=/,$val;
-      $val = $start_part unless defined $val;
+      $val =~ s/^.*=//; # suppress the Class part, just keep TYPE(0x...)
       ($item_type, $address) = 
         $val =~ /([^\(]+)        # Keep stuff that's     
                                  # not an open paren
@@ -251,7 +250,7 @@ sub unwrap {
          if ($#$v >= 0) {
            $short = $sp . "0..$#{$v}  " . 
              join(" ", 
-                  map {exists $v->[$_] ? stringify $v->[$_] : "empty"} ($[..$tArrayDepth)
+                  map {exists $v->[$_] ? stringify $v->[$_] : "empty"} (0..$tArrayDepth)
                  ) . "$shortmore";
          } else {
            $short = $sp . "empty array";
@@ -262,7 +261,7 @@ sub unwrap {
        #  print "$short\n";
        #  return;
        #}
-       for $num ($[ .. $tArrayDepth) {
+       for $num (0 .. $tArrayDepth) {
            return if $DB::signal;
            print "$sp$num  ";
            if (exists $v->[$num]) {
@@ -377,7 +376,6 @@ sub dumpglob {
       unwrap(\@entry,3+$off,$m) ;
       print( (' ' x $off) .  ")\n" );
     }
-    if ($key eq '-') { eval { require re::Tie::Hash::NamedCapture } }
     if ($key ne "main::" && $key ne "DB::" && %entry
        && ($dumpPackages or $key !~ /::$/)
        && ($key !~ /^_</ or $dumpDBFiles)