JSON: Difference between revisions
Content deleted Content added
added perl |
→{{header|Perl}}: Perl 6 solution |
||
Line 141: | Line 141: | ||
my $sample = { blue => [1,2], ocean => "water" }; |
my $sample = { blue => [1,2], ocean => "water" }; |
||
my $json_string = encode_json($sample);</lang> |
my $json_string = encode_json($sample);</lang> |
||
=={{header|Perl 6}}== |
|||
Using [http://github.com/moritz/json/] |
|||
<lang perl> |
|||
use JSON::Tiny; |
|||
my $data = from-json('{ "foo": 1, "bar": [10, "apples"] }'); |
|||
my $sample = { blue => [1,2], ocean => "water" }; |
|||
my $json_string = to-json($sample); |
|||
</lang> |
|||
=={{header|PHP}}== |
=={{header|PHP}}== |