create a json string in perl
I am trying to create a json string in perl that outputs something like this:
{"d":{"success":false, "error":"key is required"}}
I have figured out how to do it without the "d" using this example:
my %rec_hash = ('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
my $json = encode_json \%rec_hash;
print "$json\n";
but not sure what I'm suppose to do with the extra level
No comments:
Post a Comment