Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 48893
Status: resolved
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: myesildal [...] freightgate.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.15
Fixed in: (no value)



Subject: Decoding JSON into a perl variable
I am using v2.15 to encode/decode json objects. When I have a json string and try to decode it back to a perl hash, it gives me an empty hash. Here is my simple test code... $text = '{"a":111, "b":222}'; %defaultValues = $json->decode($text); while ( ($k,$v) = each %defaultValues ) { print "$k => $v\n"; } And all this prints is... HASH(0x27d52e8) => Any ideas what's wrong here? Thanks,
decode returns a reference. my $defaultValues = $json->decode($text); while ( ($k,$v) = each %$defaultValues ) { Please read the pod document. Thanks,