MARC::Moose::Record - MARC::Moose bibliographic record
version 0.022
MARC::Moose::Record is an object, Moose based object, representing a MARC::Moose bibliographic record. It can be a MARC21, UNIMARC, or whatever biblio record.
Read-only string. The leader is fixed by set_leader_length method.
ArrayRef on MARC::Moose::Field objects: MARC::Moose:Fields::Control and MARC::Moose::Field::Std.
Append a MARC::Moose::Field in the record. The record is appended at the end of numerical section, ie if you append for example a 710 field, it will be placed at the end of the 7xx fields section, just before 8xx section or at the end of fields list.
$record->append( MARC::Moose::Field::Std->new( tag => '100', subf => [ [ a => 'Poe, Edgar Allan' ], [ u => 'Translation' ] ] ) );
You can also append an array of MARC::Moose::Field. In this case, the array will be appended as for a unique field at the position of the first field of the array.
Returns a list of tags that match the field specifier, or an empty list if nothing matched. In scalar context, returns the first matching tag, or undef if nothing matched.
The field specifier can be a simple number (i.e. "245"), or use the "." notation of wildcarding (i.e. subject tags are "6.."). All fields are returned if "..." is specified.
Returns a formated version of the record as defined by format. Format are standard formater provided by the MARC::Moose::Record package: Iso2709, Text, Marcxml, Json, Yaml, Legacy.
This method is called to reset leader length of record and offset of data section. This means something only for ISO2709 formated records. So this method is exlusively called by any formater which has to build a valid ISO2709 data stream. It also forces leader position 10 and 20-23 since this variable values aren't variable at all for any ordinary MARC record.
Called by MARC::Moose::Formater::Iso2709.
$record->set_leader_length( $length, $offset );
use MARC::Moose::Record; use MARC::Moose::Field::Control; use MARC::Moose::Field::Std; use MARC::Moose::Formater::Text; my $record = MARC::Moose::Record->new( fields => [ MARC::Moose::Field::Control->new( tag => '001', value => '1234' ), MARC::Moose::Field::Std->new( tag => '245', subf => [ [ a => 'MARC is dying for ever:' ], [ b => 'will it ever happen?' ] ] ), MARC::Moose::Field::Std->new( tag => '260', subf => [ [ a => 'Paris:' ], [ b => 'Usefull Press,' ], [ c => '2010.' ], ] ), MARC::Moose::Field::Std->new( tag => '600', subf => [ [ a => 'Library' ], [ b => 'Standards' ] ] ), MARC::Moose::Field::Std->new( tag => '900', subf => [ [ a => 'My local field 1' ] ] ), MARC::Moose::Field::Std->new( tag => '901', subf => [ [ a => 'My local field 1' ] ] ), ] ); my $formater = MARC::Moose::Formater::Text->new(); print $formater->format( $record ); # Shortcut: print $record->as('Text'); $record->fields( [ grep { $_->tag < 900 } @{$record->fields} ] ); print "After local fields removing:\n", $formater->format($record);
MARC::Moose
MARC::Moose::Field
Frédéric Demians <f.demians@tamil.fr>
This software is copyright (c) 2012 by Frédéric Demians.
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 MARC::Moose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MARC::Moose
CPAN shell
perl -MCPAN -e shell install MARC::Moose
For more information on module installation, please visit the detailed CPAN module installation guide.