Skip Menu |

This queue is for tickets about the Data-Dump CPAN distribution.

Report information
The Basics
Id: 43395
Status: rejected
Priority: 0/
Queue: Data-Dump

People
Owner: Nobody in particular
Requestors: info1 [...] wolframhumann.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.14
Fixed in: (no value)



Subject: Data::Dump dies where Data::Dumper succeeds
## This is perl, v5.8.0 built for i386-linux-thread-multi I have a hash containing a class that dumps like this using Data::Dumper: $VAR1 = { 'Relays 1' => \bless( { 'len' => 16, 'masks' => [ [ \'1', 0, 1 ], [ \'0', 1, 1 ], [ \'0', 2, 1 ], #### and so on for bits 3..14 ### [ \'0', 15, 1 ] ], 'str' => '0011000011001001' }, 'Bitfield' ) }; Trying to dump the same with Data::Dump results in: Modification of a read-only value attempted at /usr/lib/perl5/5.8.0/ overload.pm line 87.
I wonder if this is a bug in perl-5.8.0. I don't have that perl available and the attached test program does not fail with any perl I have. It prints: { "Relays 1" => \bless({ len => 16, masks => [[\1, 0, 1], [\0, 1, 1], [\0, 2, 1], [\0, 15, 1]], str => "0011000011001001", }, "Bitfield"), }
#!perl -w use strict; my $VAR1 = { 'Relays 1' => \bless( { 'len' => 16, 'masks' => [ [ \'1', 0, 1 ], [ \'0', 1, 1 ], [ \'0', 2, 1 ], #### and so on for bits 3..14 ### [ \'0', 15, 1 ] ], 'str' => '0011000011001001' }, 'Bitfield' ) }; use Data::Dump; dd $VAR1;
From: w.c.humann [...] arcor.de
Thanks for the reply. You are right -- I tried the same thing using v5.8.8 and v5.10.0 and got no error message. Just in case you still want to do something for users of old versions (can't force my employer to update, can I) I let the script run using the debugger and emit a stack tace just before the error happens: DB<1> s overload::AddrRef(/usr/lib/perl5/5.8.0/overload.pm:87): 87: bless $_[0], overload::Fake; # Non-overloaded package DB<1> T $ = overload::AddrRef(ref(Bitfield)) called from file `/usr/lib/ perl5/5.8.0/overload.pm' line 94 $ = overload::StrVal(ref(Bitfield)) called from file `/home/wolframh/ perl/lib/perl5/site_perl/5.8.0/Data/Dump.pm' line 129 $ = Data::Dump::_dump(ref(Bitfield), 'a', ref(ARRAY), undef) called from file `/home/wolframh/perl/lib/perl5/site_perl/5.8.0/Data/Dump.pm' line 59 . = Data::Dump::dump(ref(Bitfield)) called from -e line 1 DB<1> s Modification of a read-only value attempted at /usr/lib/perl5/5.8.0/ overload.pm line 87. Debugged program terminated. Regards, Wolfram