Since the method decodeactually returns a hash reference, the correct way to assign it is:
%perl = %{ $coder->decode ($json) };
, , each .
while (my ($key, $value) = each %perl) {
print "$key = $value\n";
}
for my $key (keys %perl) {
print "$key = $perl{$key}\n";
}