From 54964f74243f54d078c7d7f57ff24310a7f5b499 Mon Sep 17 00:00:00 2001 From: Gisle Aas Date: Tue, 5 Sep 2000 10:11:40 +0200 Subject: [PATCH] Make Data::Dumper (non-XS) to work with changed semantics of ref(). Subject: Re: Undocumented(?) change to "ref" semantics in 5.7.0 Message-ID: p4raw-id: //depot/perl@7025 --- ext/Data/Dumper/Dumper.pm | 5 ++--- t/lib/dumper.t | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index 0ff48e6..a8e59ab 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -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}") . ')}'; } diff --git a/t/lib/dumper.t b/t/lib/dumper.t index 183442d..be9732f 100755 --- a/t/lib/dumper.t +++ b/t/lib/dumper.t @@ -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 -- 1.8.3.1