The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

    use Catmandu::Importer::YAML;

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

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

    The YAML input file needs to be separated into records:

    ---
    - recordno: 1
    - name: Alpha
    ---
    - recordno: 2
    - name: Beta
    ...

    where '---' is the record separator and '...' the EOF indicator.

METHODS

new([file => $filename])

Create a new YAML importer for $filename. Use STDIN when no filename is given.

count

each(&callback)

...

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

SEE ALSO

Catmandu::Iterable