Subject: | JSON::PP is unable to decode JSON with newlines between tokens |
The file pretty.json below does not parse, but compact.json parses.
This is tested on both perl 5.18.2 and perl 5.20.2 on Ubuntu 14.04 (64-bit). The 5.18.2 perl version is system perl. 5.20.2 is perlbrewed with --thread --multi arguments.
$ cat pretty.json
{
"a":"b",
"c":1
}
$ cat compact.json
{"a":"b","c":1}
$ perl -MFile::Slurp -MJSON::PP -E 'say decode_json read_file shift' compact.json
HASH(0xa06d18)
$ perl -MFile::Slurp -MJSON::PP -E 'say decode_json read_file shift' pretty.json
, or } expected while parsing object/hash, at character offset 1 (before "\n") at -e line 1.
$