| CPAN Ratings Reviews by Markus Peter | |
| Home | Search | About | Bitcard Account | Login |
Great, finally reliable subroutine attributes!
Markus Peter - 2010-01-06T01:15:35
JSON::Syck is nice, if you need a compact serialization and you will always only use JSON::Syck do actually deserialize your data, but it will not properly work with other JSON decoders and can sometimes generate faulty JavaScript, too.
This is clearly a tweaked YAML encoder and it will generate serializations which are not valid JSON and sometimes, in edge cases, not even valid JavaScript.
Some things you have to look-out for which are still unfixed in the latest version (I have not reported these as bugs anymore as the author now also recommends another module):
- Randomly changes which quotes it outputs - sometimes seems to use " (which is correct JSON), sometimes it uses ' (which is not correct JSON but at least correct JavaScript)
- Will sometimes wrongly escape ' characters and then output '' (that's two apostrophes) instead of \' - this breaks the syntax of your JavaScripts, should you directly include JSON::Syck results into your scripts
- The handling of 8-bit characters is wildly inconsistent. Sometimes they'll be inserted as-is, sometimes it will wrongly escape them with \x - which is valid Perl but not valid JavaScript
As the author said: For true JSON encoding you should probably better use JSON::XS. I, by the way, wildly appreciate that the author recommends a better module - I first found JSON::XS through the hint in the documentation here.
Markus Peter - 2009-06-23T01:49:05
We've used JSON::Syck before and experienced troubles with it after a while as it generates "JSON" which is sometimes not even valid JavaScript.
We've since switched to this module - if you ever need JSON encoding/decoding - use this!
Markus Peter - 2009-06-23T01:41:58
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|