Jifty::JSON -- Wrapper around JSON
Provides a wrapper around the JSON library.
The JSON specification at http://www.json.org/ states that only double-quotes are possible for specifying strings. However, for the purposes of embedding Javascript-compatible objects in XHTML attributes (which use double-quotes), we sometimes want to provide strings in single quotes. This provides a version of "objToJson" in JSON which allows single-quoted string output.
If the faster JSON::Syck is available, it is preferred over the pure-perl JSON, as it provides native support for single-quoted strings..
For completeness, Jifty::JSON provides a jsonToObj. It is identical to "jsonToObj" in JSON.
Jifty::JSON
jsonToObj
This method is identical to "objToJson" in JSON, except it has an additional possible option. The singlequote option, if set to a true value in the ARGUMENTS hashref, overrides JSON::Converter's string output method to output single quotes as delimters instead of double quotes.
singlequote
ARGUMENTS
To install Jifty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Jifty
CPAN shell
perl -MCPAN -e shell install Jifty
For more information on module installation, please visit the detailed CPAN module installation guide.