diff options
author | Gisle Aas <gisle@aas.no> | 2000-09-05 10:11:40 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-09-07 18:42:27 +0000 |
commit | 54964f74243f54d078c7d7f57ff24310a7f5b499 (patch) | |
tree | 5cf383c380aa049411dfc37bc8ff185dac364032 | |
parent | 7c011d3a307861c607d64ca70fbcd88674e57e79 (diff) | |
download | perl-54964f74243f54d078c7d7f57ff24310a7f5b499.tar.gz |
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: <m3snrf8j1f.fsf@eik.g.aas.no>
p4raw-id: //depot/perl@7025
-rw-r--r-- | ext/Data/Dumper/Dumper.pm | 5 | ||||
-rwxr-xr-x | 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 0ff48e648c..a8e59ab379 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 183442d355..be9732f1d6 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 |