JSON

JSON (JavaScript Object Notation) encoder/decoder
Download

JSON Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Makamaka Hannyaharamitu
  • Publisher web site:
  • http://search.cpan.org/~makamaka/

JSON Tags


JSON Description

JSON (JavaScript Object Notation) encoder/decoder JSON (JavaScript Object Notation) is a simple data format. See to http://www.json.org/ and RFC4627(http://www.ietf.org/rfc/rfc4627.txt).JSON is a Perl module that converts Perl data structures to JSON and vice versa using either JSON::XS or JSON::PP.JSON::XS is the fastest and most proper JSON module on CPAN which must be compiled and installed in your environment. JSON::PP is a pure-Perl module which is bundled in this distribution and has a strong compatibility to JSON::XS.This module try to use JSON::XS by default and fail to it, use JSON::PP instead. So its features completely depend on JSON::XS or JSON::PP.SYNOPSIS use JSON; # imports encode_json, decode_json, to_json and from_json. $json_text = to_json($perl_scalar); $perl_scalar = from_json($json_text); # option-acceptable $json_text = to_json($perl_scalar, {ascii => 1}); $perl_scalar = from_json($json_text, {utf8 => 1}); # OOP $json = new JSON; $json_text = $json->encode($perl_scalar); $perl_scalar = $json->decode($json_text); # pretty-printing $json_text = $json->pretty->encode($perl_scalar); # simple interface $utf8_encoded_json_text = encode_json $perl_hash_or_arrayref; $perl_hash_or_arrayref = decode_json $utf8_encoded_json_text; # If you want to use PP only support features, call with '-support_by_pp' # When XS unsupported feature is enable, using PP de/encode. use JSON -support_by_pp; Requirements: · Perl


JSON Related Software