Catmandu::Exporter::CSV - a CSV exporter
use Catmandu::Exporter::CSV; my $exporter = Catmandu::Exporter::CSV->new( fix => 'myfix.txt' quote_char => '"' , escape_char => '"' , always_quote => 1, sep_char => ',' , header => 1); $exporter->fields("f1,f2,f3"); $exporter->fields([qw(f1 f2 f3)]); # add custom header labels $exporter->header({f2 => 'field two'}); $exporter->add_many($arrayref); $exporter->add_many($iterator); $exporter->add_many(sub { }); $exporter->add($hashref); printf "exported %d objects\n" , $exporter->count;
Creates a new Catmandu::Exporter::CSV. Optionally set the field and column boundaries with quote_char , sep_char and always_quote. A header line with field names will be included if header is set. Field names can be read from the first item exported or set by the fields argument (see: fields).
header
fields
Set the field names by an ARRAY reference.
Set the field names by the keys of a HASH reference.
Set the fields by a comma delimited string.
Include a header line with the field names
Include a header line with custom field names
Catmandu::Exporter
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.