ron800 has asked for the wisdom of the Perl Monks concerning the following question:
My files are multiple megabytes and reading them into a string for parsing is not realistic. Any suggestions would be appreciated.use JSON::Parse 'assert_valid_json'; unless (valid_json ($json)) { # do something } eval { assert_valid_json ('["xyz":"b"]'); }; if ($@) { print "Your JSON was invalid: $@\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Verify syntax of large JSON files
by Loops (Curate) on Nov 23, 2014 at 04:40 UTC | |
by ron800 (Novice) on Nov 23, 2014 at 14:29 UTC | |
by tye (Sage) on Nov 23, 2014 at 22:58 UTC | |
by graff (Chancellor) on Nov 24, 2014 at 06:31 UTC |