Nicolas Steenlant > Catmandu-0.09 > Catmandu::Importer::CSV

Download:
Catmandu-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Catmandu-0.9204

NAME ^

Catmandu::Importer::CSV - Package that imports CSV data

SYNOPSIS ^

    use Catmandu::Importer::CSV;

    my $importer = Catmandu::Importer::CSV->new(file => "/foo/bar.csv");

    my $n = $importer->each(sub {
        my $hashref = $_[0];
        # ...
    });

METHODS ^

new(file => $filename, fields => \@fields, quote_char => "\"", sep_char => ",")

Create a new CSV importer for $filename. Use STDIN when no filename is given. The object fields are read from the CSV header line or given via the 'fields' parameter. Strings in CSV are quoted by 'quote_char' and fields are separated by 'sep_char'.

count

each(&callback)

...

Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. The Catmandu::Importer::CSV methods are not idempotent: CSV streams can only be read once.

SEE ALSO ^

Catmandu::Iterable

syntax highlighting: