perl json

886 단어 jsonperl
http://search.cpan.org/~makamaka/JSON-2.53/lib/JSON.pm#decode_json
use JSON;
$json_text = '{"x":1, "y":["a", "b"]}';
$perl_scalar = from_json( $json_text);
print $perl_scalar->{y}->[0];
$json_text   = to_json( $perl_scalar);
print "
", $json_text; json , key , , use JSON -support_by_pp; $json_text = '{"x":1, "y":["a", "b"], z:123}'; use JSON -support_by_pp; $perl_scalar = from_json( $json_text, {allow_barekey=>1}); json ,allow_xx, allow_barekey json key allow_singlequote json key

좋은 웹페이지 즐겨찾기