Catmandu::Exporter - Namespace for packages that can export a hashref or an iterable object
use Catmandu::Exporter::YAML; my $exporter = Catmandu::Exporter::YAML->new(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;
Create a new Catmandu::Exporter. When no options are given exported data is written to the stdout. Optionally provide a 'file' pathname or a 'fh' file handle to redirect the ouput.
Every Catmandu::Exporter is a Catmandu::Fixable and thus provides a 'fix' parameter that can be set in the constructor. For every 'add' or for every item in 'add_many' the given fixes will be applied first.
Adds one object to be exported. Provide a HASH-ref or an Catmandu::Iterator to loop. Returns a true value when the export was successful or undef on error.
Provide one or more objects to be exported. The exporter will use array references, iterators and generator routines to loop over all items. Returns the total number of items exported.
Returns the number of items exported by this Catmandu::Exporter.
Catmandu::Exporter::Fix
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu
CPAN shell
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.