Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Jifty::JSON -- Wrapper around L<JSON>

Jifty::JSON -- Wrapper around L<JSON>


NAME

Jifty::JSON -- Wrapper around JSON


SYNOPSIS


  use Jifty::JSON;

  # Even though you might be using JSON::Syck, use the original JSON names

  my $obj  = jsonToObj(q! { 'x': 1, 'y': 2, 'z': 3 } !);

  my $json = objToJson($obj);


DESCRIPTION

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 JSON/objToJson which allows single-quoted string output.

If the faster the JSON::Syck manpage is available, it is preferred over the pure-perl JSON, as it provides native support for single-quoted strings.


METHODS

jsonToObj JSON, [ARGUMENTS]

For completeness, Jifty::JSON provides a jsonToObj. It is identical to JSON/jsonToObj.

objToJson OBJECT, [ARGUMENTS]

This method is identical to JSON/objToJson, except it has an additional possible option. The singlequote option, if set to a true value in the ARGUMENTS hashref, overrides the JSON::Converter manpage's string output method to output single quotes as delimters instead of double quotes.


LICENSE

Jifty is Copyright 2005-2006 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy