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

NAME

PICA::Writer::Base - Base class of PICA+ writers

SYNOPSIS

    use PICA::Writer::Plain;
    my $writer = PICA::Writer::Plain->new( $fh );

    foreach my $record (@pica_records) {
        $writer->write($record);
    }

    use PICA::Writer::Plus;
    $writer = PICA::Writer::Plus->new( $fh );
    ...

    use PICA::Writer::XML;
    $writer = PICA::Writer::XML->new( $fh );
    ...

DESCRIPTION

This abstract base class of PICA+ writers should not be instantiated directly. Use one of the following subclasses instead:

PICA::Writer::Plain
PICA::Writer::Plus
PICA::Writer::XML

METHODS

new( [ $fh | fh => $fh ] )

Create a new PICA writer, writing to STDOUT by default. The optional fh argument can be a filename, a handle or any other blessed object with a print method, e.g. IO::Handle.

PICA::Data also provides a functional constructor pica_writer.

write ( @records )

Writes one or more records, given as hash with key 'record' or as array reference with a list of fields, as described in PICA::Data.

write_record ( $record )

Writes one record.

SEEALSO

See Catmandu::Exporter::PICA for usage of this module within the Catmandu framework (recommended).

Alternative (outdated) PICA+ writers had been implemented as PICA::Writer and PICA::XMLWriter included in the release of PICA::Record.