Nicolas Steenlant > Catmandu-0.0902 > Catmandu::Importer::YAML

Download:
Catmandu-0.0902.tar.gz

Dependencies

Annotate this POD

CPAN RT

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

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

syntax highlighting: