This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make Data::Dumper (non-XS) to work with changed semantics of ref().
authorGisle Aas <gisle@aas.no>
Tue, 5 Sep 2000 08:11:40 +0000 (10:11 +0200)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 7 Sep 2000 18:42:27 +0000 (18:42 +0000)
Subject: Re: Undocumented(?) change to "ref" semantics in 5.7.0
Message-ID: <m3snrf8j1f.fsf@eik.g.aas.no>

p4raw-id: //depot/perl@7025

ext/Data/Dumper/Dumper.pm
t/lib/dumper.t

index 0ff48e6..a8e59ab 100644 (file)
@@ -9,7 +9,7 @@
 
 package Data::Dumper;
 
-$VERSION = '2.101';
+$VERSION = '2.102';
 
 #$| = 1;
 
@@ -291,8 +291,7 @@ sub _dump {
     $s->{level}++;
     $ipad = $s->{xpad} x $s->{level};
 
-    
-    if ($realtype eq 'SCALAR') {
+    if ($realtype eq 'SCALAR' || $realtype eq 'REF') {
       if ($realpack) {
        $out .= 'do{\\(my $o = ' . $s->_dump($$val, "\${$name}") . ')}';
       }
index 183442d..be9732f 100755 (executable)
@@ -262,11 +262,14 @@ EOT
 ##
 $WANT = <<'EOT';
 #$VAR1 = {
-#  "abc\0'\efg" => "mno\0"
+#  "abc\0'\efg" => "mno\0",
+#  "reftest" => \\1
 #};
 EOT
 
-$foo = { "abc\000\'\efg" => "mno\000" };
+$foo = { "abc\000\'\efg" => "mno\000",
+         "reftest" => \\1,
+       };
 {
   local $Data::Dumper::Useqq = 1;
   TEST q(Dumper($foo));
@@ -274,7 +277,8 @@ $foo = { "abc\000\'\efg" => "mno\000" };
 
   $WANT = <<"EOT";
 #\$VAR1 = {
-#  'abc\0\\'\efg' => 'mno\0'
+#  'abc\0\\'\efg' => 'mno\0',
+#  'reftest' => \\\\1
 #};
 EOT