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

NAME

PICA::Data - PICA record processing

VERSION

version 0.12

DESCRIPTION

This module is aggregated methods and functions to process parsed PICA records, represented by an array of arrays.

FUNCTIONS

pica_values( $record, $path )

Adopted from Catmandu::Fix::pica_map, function can be used to extract a list of subfield values from a PICA record based on a PICA path expression.

This function can also be called as values on a blessed PICA::Data record:

    bless $record, 'PICA::Data';
    $record->values($path);

pica_value( $record, $path )

Same as pica_values but only returns the first value. Can also be called as value on a blessed PICA::Data record.

pica_fields( $record, $path )

Returns a PICA record limited to fields specified in a PICA path expression. Always returns an array reference. Can also be called as fields on a blessed PICA::Data record.

parse_pica_path( $path )

Parses a PICA path expression. On success returns a list reference with:

  • regex string to match fields against (must be compiled with qr{...} or /.../)

  • regex string to match occurrences against (must be compiled)

  • regex string to match subfields against (must be compiled)

  • substring start position

  • substring end position

SEEALSO

PICA::Record implements an alternative, more heavyweight encoding of PICA records.

AUTHOR

Johann Rolschewski <rolschewski@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Johann Rolschewski.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.