|
|
1 | =encoding utf-8 |
|
|
2 | |
1 | =head1 NAME |
3 | =head1 NAME |
2 | |
4 | |
3 | JSON::XS - JSON serialising/deserialising, done correctly and fast |
5 | JSON::XS - JSON serialising/deserialising, done correctly and fast |
|
|
6 | |
|
|
7 | JSON::XS - 正しくて高速な JSON シリアライザ/デシリアライザ |
|
|
8 | (http://fleur.hio.jp/perldoc/mix/lib/JSON/XS.html) |
4 | |
9 | |
5 | =head1 SYNOPSIS |
10 | =head1 SYNOPSIS |
6 | |
11 | |
7 | use JSON::XS; |
12 | use JSON::XS; |
8 | |
13 | |
… | |
… | |
309 | ] |
314 | ] |
310 | { |
315 | { |
311 | "k1": "v1", |
316 | "k1": "v1", |
312 | "k2": "v2", <- this comma not normally allowed |
317 | "k2": "v2", <- this comma not normally allowed |
313 | } |
318 | } |
|
|
319 | |
|
|
320 | =item * shell-style '#'-comments |
|
|
321 | |
|
|
322 | Whenever JSON allows whitespace, shell-style comments are additionally |
|
|
323 | allowed. They are terminated by the first carriage-return or line-feed |
|
|
324 | character, after which more white-space and comments are allowed. |
|
|
325 | |
|
|
326 | [ |
|
|
327 | 1, # this comment not allowed in JSON |
|
|
328 | # neither this one... |
|
|
329 | ] |
314 | |
330 | |
315 | =back |
331 | =back |
316 | |
332 | |
317 | =item $json = $json->canonical ([$enable]) |
333 | =item $json = $json->canonical ([$enable]) |
318 | |
334 | |
… | |
… | |
655 | to_json [\0,JSON::XS::true] # yields [false,true] |
671 | to_json [\0,JSON::XS::true] # yields [false,true] |
656 | |
672 | |
657 | =item JSON::XS::true, JSON::XS::false |
673 | =item JSON::XS::true, JSON::XS::false |
658 | |
674 | |
659 | These special values become JSON true and JSON false values, |
675 | These special values become JSON true and JSON false values, |
660 | respectively. You cna alos use C<\1> and C<\0> directly if you want. |
676 | respectively. You can also use C<\1> and C<\0> directly if you want. |
661 | |
677 | |
662 | =item blessed objects |
678 | =item blessed objects |
663 | |
679 | |
664 | Blessed objects are not allowed. JSON::XS currently tries to encode their |
680 | Blessed objects are not allowed. JSON::XS currently tries to encode their |
665 | underlying representation (hash- or arrayref), but this behaviour might |
681 | underlying representation (hash- or arrayref), but this behaviour might |