> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/perl6-rosettacode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/perl6-rosettacode/programming_tasks/j/json.md).

# JSON

Using [JSON::Tiny](https://github.com/moritz/json/)

```perl
use JSON::Tiny;

say from-json '{ "foo": 1, "bar": [10, "apples"] }';
say to-json   %( blue => [1,2], ocean => "water" );
```

#### Output:

```
{bar => [10 apples], foo => 1}
{ "blue" : [ 1, 2 ], "ocean" : "water" }
```
