in reply to perl-json format
It seems that @my_A contains a string which is already JSON-encoded. Passing it to encode_json double-encodes it, ie escapes all quotes with backslashes.
If that is the case, you can produce your desired result through a simple text operation, like
my $json_output = '{"JSON1:[" . join(',', @my_A) .']}';
of you have to decode the existing JSON string before inserting it into a data structure that you pass to encode_json.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl-json format
by divyaP (Initiate) on Apr 18, 2012 at 06:53 UTC |