Nicolas Steenlant > Catmandu > Catmandu::Exporter::JSON

Download:
Catmandu-0.9208.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

Catmandu::Exporter::JSON - a JSON exporter

SYNOPSIS ^

Command line interface:

    catmandu convert YAML to JSON --pretty 1 < input.yml

In Perl code:

    use Catmandu -all;

    my $exporter = exporter('JSON', fix => 'myfix.txt');

    $exporter->add_many($arrayref);
    $exporter->add_many($iterator);
    $exporter->add_many(sub { });

    $exporter->add($hashref);

    printf "exported %d objects\n" , $exporter->count;

DESCRIPTION ^

This Catmandu::Exporter exports items serialized in JSON format. By default each item is printed condensed on one line.

CONFIGURATION ^

file
fh
fix
encoding

Default options of Catmandu::Exporter.

pretty
indent
space_before
space_after
canonical

JSON serialization options.

array

Seralize items as one JSON array instead of concatenated JSON objects.

METHODS ^

See Catmandu::Exporter

SEE ALSO ^

Catmandu::Exporter::YAML

syntax highlighting: