Catmandu::Exporter::MARC - serialize parsed MARC data
use Catmandu::Exporter::MARC; my $exporter = Catmandu::Exporter::MARC->new(file => "marc.xml", type => "XML" ); my $data = { record => [ ... [245, '1', '0', 'a', 'Cross-platform Perl /', 'c', 'Eric F. Johnson.'], ... ], }; $exporter->add($data); $exporter->commit; # When the record format is MARC-in-JSON: my $exporter = Catmandu::Exporter::MARC->new( file => 'marc.xml' , type => 'XML' record_format => "MARC-in-JSON"); my $data = { 'leader' => '01471cjm a2200349 a 4500', fields => [ { '001' => '5674874' } , { '245' => { subfields => [ { a => 'My Title ' } ] }} , ... ] }; $exporter->add($data); $exporter->commit; # Export record to ALEPH sequential my $exporter = Catmandu::Exporter::MARC->new(file => 'aleph.txt' , type => 'ALEPHSEQ');
Create a new Catmandu MARC exports which serializes into a $file. Optionally provide xml_declaration => 0|1 to in/exclude a XML declaration and, collection => 0|1 to include a MARC collection header and skip_empty_subfields => 0|1 to skip fields that contain no data.
Other supported export formats: * type => ALEPHSEQ
Catmandu::Exporter
To install Catmandu::MARC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::MARC
CPAN shell
perl -MCPAN -e shell install Catmandu::MARC
For more information on module installation, please visit the detailed CPAN module installation guide.