™.. JSON::Syck - Online Linux Manual PageSection : 3
Updated : 2009-04-25
Source : perl v5.10.1
Note : User Contributed Perl Documentation

NAMEJSON::Syck − JSON is YAML (but consider using JSON::XS instead!)

SYNOPSIS​ use JSON::Syck; # no exports by default ​ ​ my $data = JSON::Syck::Load($json); ​ my $json = JSON::Syck::Dump($data); ​ ​ # $file can be an IO object, or a filename ​ my $data = JSON::Syck::LoadFile($file); ​ JSON::Syck::DumpFile($file, $data);

DESCRIPTIONJSON::Syck is a syck implementation of JSON parsing and generation. Because ​JSON is YAML (<http://redhanded.hobix.com/inspect/yamlIsJson.html>), using syck gives you a fast and memory-efficient parser and dumper for JSON data representation. However, a newer module JSON::XS, has since emerged. It is more flexible, efficient and robust, so please consider using it instead of this module.

DIFFERENCE WITH JSONYou might want to know the difference between the JSON module and this one. Since JSON is a pure-perl module and JSON::Syck is based on libsyck, JSON::Syck is supposed to be very fast and memory efficient. See chansen's benchmark table at <http://idisk.mac.com/christian.hansen/Public/perl/serialize.pl> JSON.pm comes with dozens of ways to do the same thing and lots of options, while JSON::Syck doesn't. There's only \*(C`Load\*(C'\fR and \f(CW\*(C`Dump\*(C'\fR. Oh, and JSON::Syck doesn't use camelCase method names :−)

REFERENCES

SCALAR REFERENCEFor now, when you pass a scalar reference to JSON::Syck, it dereferences to get the actual scalar value. JSON::Syck raises an exception when you pass in circular references. If you want to serialize self refernecing stuff, you should use ​YAML which supports it.

SUBROUTINE REFERENCEWhen you pass subroutine reference, JSON::Syck dumps it as null.

UTF−8 FLAGSBy default this module doesn't touch any of utf−8 flags set in strings, and assumes UTF−8 bytes to be passed and emit. However, when you set $JSON::Syck::ImplicitUnicode to 1, this module properly decodes UTF−8 binaries and sets UTF−8 flag everywhere, as in: ​ JSON (UTF−8 bytes) => Perl (UTF−8 flagged) ​ JSON (UTF−8 flagged) => Perl (UTF−8 flagged) ​ Perl (UTF−8 bytes) => JSON (UTF−8 flagged) ​ Perl (UTF−8 flagged) => JSON (UTF−8 flagged) Unfortunately, there's no implicit way to dump Perl UTF−8 flagged data structure to utf−8 encoded JSON. To do this, simply use Encode module, e.g.: ​ use Encode; ​ use JSON::Syck qw(Dump); ​ ​ my $json = encode_utf8( Dump($data) ); Alternatively you can use Encode::JavaScript::UCS to encode Unicode strings as in %uXXXX form. ​ use Encode; ​ use Encode::JavaScript::UCS; ​ use JSON::Syck qw(Dump); ​ ​ my $json_unicode_escaped = encode( 'JavaScript−UCS', Dump($data) );

QUOTINGAccording to the JSON specification, all JSON strings are to be double-quoted. However, when embedding JavaScript in HTML attributes, it may be more convenient to use single quotes. Set $JSON::Syck::SingleQuote to 1 will make both \*(C`Dump\*(C'\fR and \f(CW\*(C`Load\*(C'\fR expect single-quoted string literals.

SEE ALSOJSON::XS,

AUTHORSAudrey Tang <cpan@audreyt.org> Tatsuhiko Miyagawa <miyagawa@gmail.com>

COPYRIGHTCopyright 2005−2009 by Audrey Tang <cpan@audreyt.org>. This software is released under the MIT license cited below. The libsyck code bundled with this library is released by ​why the lucky stiff, under a BSD-style license. See the COPYING file for details.

The ``MIT'' LicensePermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ​FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALLTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE.
0
Johanes Gumabo
Data Size   :   18,154 byte
man-JSON::Syck.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 166,432
Visitor ID   :     :  
Visitor IP   :   3.133.120.64   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|JSON::Syck.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|JSON::Syck.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|JSON::Syck.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|JSON::Syck.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|JSON::Syck.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|JSON::Syck.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|JSON::Syck.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|JSON::Syck.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|JSON::Syck.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|JSON::Syck.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|JSON::Syck.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|JSON::Syck.3pm|166|\*(C`Load\*(C'\fR and \f(CW\*(C`Dump\*(C'\fR. |options, while JSON::Syck doesn't. There's only \f(CW\*(C`Load\*(C'\fR and \f(CW\*(C`Dump\*(C'\fR. )         (rof_escape_sequence|91|JSON::Syck.3pm|225|\*(C`Dump\*(C'\fR and \f(CW\*(C`Load\*(C'\fR expect |Set \f(CW$JSON::Syck::SingleQuote\fR to 1 will make both \f(CW\*(C`Dump\*(C'\fR and \f(CW\*(C`Load\*(C'\fR expect )