in reply to Re^2: keys in reference experimental or reference is deprecated
in thread keys in reference experimental or reference is deprecated

Does this help?

Not as much as it could; because its data is not bundled with the code it is not a short, self-contained example. To provide a complete answer someone would have to do the extra work of reverse-engineering your data-structure to figure out what it looked like in the first place. And frankly, many potential answers will not be written, or will be less helpful than they could have been because the prospect of extra, error-prone work of reverse-engineering sample data from code that is known to be buggy discourages people from helping, particularly when it would not be much effort for the person asking to provide a small data sample in the first place.

Your code snippet could have been like this:

use strict; use warnings; use JSON qw(decode_json); my $json_decoded = decode_json(do {local $/ = undef; <DATA>}); #...your code goes here... __DATA__ {"foo":"bar", "baz":["buzz":1] }

...or...

use strict; use warnings; my $json_decoded = {foo => 'bar', baz => ['buzz', 1]}; # Your code goes here...

In either case we would have all the facts in front of us, and could run your sample code and see the output you are seeing.

At any rate, see my answer at a higher-level in this thread for an explanation of the benefit of diagnostics when a terse error message feels cryptic.


Dave

Replies are listed 'Best First'.
Re^4: keys in reference experimental or reference is deprecated
by demichi (Beadle) on Nov 17, 2016 at 16:45 UTC
    You are right, I apologize for that. Will do better the next time.