Catmandu::Importer::MAB2 - Package that imports MAB2 data
version 0.03
use Catmandu::Importer::MAB2; my $importer = Catmandu::Importer::MAB2->new(file => "./t/mab2.dat", type=> "RAW"); my $n = $importer->each(sub { my $hashref = $_[0]; # ... });
The parsed MAB2 is a HASH containing two keys '_id' containing the 001 field (or the system identifier of the record) and 'record' containing an ARRAY of ARRAYs for every field:
{ 'record' => [ [ '001', ' ', '_', 'fol05882032 ' ], [ 245, 'a', 'a', 'Cross-platform Perl /', 'c', 'Eric F. Johnson.' ], ], '_id' => 'fol05882032' }
Create a new MAB2 importer for $filename. Use STDIN when no filename is given. Type describes the sytax of the MAB records. Currently we support: RAW, XML and Disk.
Optionally provide an 'id' option pointing to the identifier field of the MAB record (default 001).
Every Catmandu::Importer is a Catmandu::Iterable all its methods are inherited. The Catmandu::Importer::MAB methods are not idempotent: MAB feeds can only be read once.
Catmandu::Importer, Catmandu::Iterable;
Johann Rolschewski <rolschewski@gmail.com>
This software is copyright (c) 2013 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.
To install Catmandu::MAB2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::MAB2
CPAN shell
perl -MCPAN -e shell install Catmandu::MAB2
For more information on module installation, please visit the detailed CPAN module installation guide.