NAME

MARC::Moose::Record - MARC::Moose bibliographic record

VERSION

version 0.007

DESCRIPTION

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.

ATTRIBUTES

leader

Read-only string. The leader is fixed by set_leader_length method.

fields

ArrayRef on MARC::Moose::Field objects: MARC::Moose:Fields::Control and MARC::Moose::Field::Std.

METHODS

append( field )

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' ] ]
 ) );

field( tag )

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.

set_leader_length( length, offset )

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 );

SYNOPSYS

 use MARC::Moose::Record;
 use MARC::Moose::Reader::File;
 use MARC::Moose::Parser::Iso2709;
 use MARC::Moose::Formater::Text;

 my $reader = MARC::Moose::Reader::File->new(
     file   => 'biblio.iso',
     parser => MARC::Moose::Parser::Iso2709->new()
 );
 my $formater = MARC::Moose::Formater::Text->new();
 while ( my $record = $reader->read() ) {
     print $formater->format( $record );
 }

SEE ALSO

AUTHOR

Frederic Demians <f.demians@tamil.fr>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Frederic 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.