NAME
PICA::Parser::Base - abstract base class of PICA parsers
SYNOPSIS
use PICA::Parser::Plain;
my $parser = PICA::Parser::Plain->new( $filename );
while ( my $record_hash = $parser->next ) {
# do something
}
use PICA::Parser::Plus;
my $parser = PICA::Parser::Plus->new( $filename );
...
use PICA::Parser::XML;
my $parser = PICA::Parser::XML->new( $filename, start => 1 );
...
DESCRIPTION
This abstract base class of PICA+ parsers should not be instantiated directly. Use one of the following subclasses instead:
METHODS
new( [ $input | fh => $input ] [ %options ] )
Initialize parser to read from a given file, handle (e.g. IO::Handle), or string reference. The PICA::Parser::XML also detects plain XML strings.
next
Reads the next PICA+ record. Returns a hash with keys _id
and record
, as defined in PICA::Data.
next_record
Reads the next PICA+ record. Returns an array of field arrays.
SEEALSO
See Catmandu::Importer::PICA for usage of this module in Catmandu.
Alternative PICA parsers had been implemented as PICA::PlainParser and PICA::XMLParser and included in the release of PICA::Record (outdated).