← Back to context

Comment by serallak

2 days ago

> JavaScript / Ruby / Python: All provide JSON-style literals ([1,2,[3,4]], {"x":1,"y":[2,3]})

The Perl syntax for this is pretty similar:

[1,2,[3,4]], {"x", 1,"y", [2,3]}

that can also be written, with a bit of syntactic sugar:

[1,2,[3,4]], {x => 1, y => [2,3]}

For many, if not most, cases, given a Perl data structure, the round trip "Perl -> JSON -> Perl" is transparent.