Skip Menu |

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

Report information
The Basics
Id: 114516
Status: open
Priority: 0/
Queue: Data-Walk

People
Owner: Nobody in particular
Requestors: trantorvega [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 2.00
  • 2.01
Fixed in: (no value)



Subject: "Modification of a read-only value" error since upgrading to version 2.00 from 1.00
Hello. I noticed how my code breaks after upgrading from version 1.00 . Versions 2.00 and 2.01 are both affected. What happens is that while walking a data structure decoded from JSON by the JSON::XS module (something which works nicely using version 1.00) I get the error below. "Modification of a read-only value attempted at /usr/local/share/perl/5.18.2/Data/Walk.pm line 113." From what I seem to understand there's a problem with the value aliased to $_ . Below an excerpt from the data structure serialized with Data::Dumper. $VAR1 = { 'name' => 'USER_ROOT', 'imapItemCount' => 0, 'isSyncFolder' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ), } The module explodes when $_ is aliased to "bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' )" from what I can see.
On Fri May 20 05:12:39 2016, trantorvega@gmail.com wrote: Show quoted text
> What happens is that while walking a data structure decoded from JSON > by the JSON::XS module (something which works nicely using version > 1.00) I get the error below. > > "Modification of a read-only value attempted at > /usr/local/share/perl/5.18.2/Data/Walk.pm line 113."
I hit this too. The problem is this: # Avoid fancy overloading stuff. bless $item if $blessed; You can reproduce the issue with this: #!/usr/bin/env perl use strict; use warnings; use JSON; use Data::Walk; use Devel::Peek; my $data = decode_json '[false]'; #Dump($data); walk sub {}, $data;