in reply to Re^2: Write json structure to a file
in thread Write json structure to a file
Alternatively, you could sort the hash keys on the receiving end in Javascript into a particular order (put the key names in another hash with the sort positions as values for use in a sort function in Javascript) but that would be outside the scope of the monastery.use strict; use warnings; binmode STDOUT, ":utf8"; use utf8; use JSON; my $json ={ 'book' => [ {'title' => 'smth'}, {'num_page' => 234} ] }; open my $fh, ">", "data_out.json"; print $fh encode_json($json); close $fh;
One world, one people
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Write json structure to a file
by Anonymous Monk on Oct 20, 2017 at 05:26 UTC | |
by Corion (Patriarch) on Oct 20, 2017 at 08:38 UTC | |
by Anonymous Monk on Oct 24, 2017 at 04:46 UTC | |
by hippo (Archbishop) on Oct 20, 2017 at 08:31 UTC | |
by Anonymous Monk on Oct 24, 2017 at 04:48 UTC |