Catmandu::Importer::JSON
Package that imports JSON data
- Provided by: libcatmandu-perl (Version: 0.9505-1)
- Report a bug
Package that imports JSON data
use Catmandu::Importer::JSON;
my $importer = Catmandu::Importer::JSON->new(file => "/foo/bar.json");
my $n = $importer->each(sub {
my $hashref = $_[0];
# ...
});
The defaults assume a newline delimited JSON file:
{ "recordno": 1, "name": "Alpha" }
{ "recordno": 2, "name": "Beta" }
{ "recordno": 3, "name": "Gamma" }
Use the "multiline" or "array" options to parse pretty-printed JSON or JSON arrays.
Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. The methods are not idempotent: JSON streams can only be read once.
Catmandu::Exporter::JSON