Dobrica Pavlinusic > MARC-Fast-0.09 > MARC::Fast

Download:
MARC-Fast-0.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.09   Source  

NAME ^

MARC::Fast - Very fast implementation of MARC database reader

SYNOPSIS ^

  use MARC::Fast;

  my $marc = new MARC::Fast(
        marcdb => 'unimarc.iso',
  );

  foreach my $mfn ( 1 .. $marc->count ) {
        print $marc->to_ascii( $mfn );
  }

For longer example with command line options look at "dump_fastmarc.pl" in scripts

DESCRIPTION ^

This is very fast alternative to MARC and MARC::Record modules.

It's is also very subtable for random access to MARC records (as opposed to sequential one).

METHODS ^

new

Read MARC database

  my $marc = new MARC::Fast(
        marcdb => 'unimarc.iso',
        quiet => 0,
        debug => 0,
        assert => 0,
        hash_filter => sub {
                my ($t, $record_number) = @_;
                $t =~ s/foo/bar/;
                return $t;
        },
  );

count

Return number of records in database

  print $marc->count;

fetch

Fetch record from database

  my $hash = $marc->fetch(42);

First record number is 1

last_leader

Returns leader of last record fetched

  print $marc->last_leader;

Added in version 0.08 of this module, so if you need it use:

  use MARC::Fast 0.08;

to be sure that it's supported.

to_hash

Read record with specified MFN and convert it to hash

  my $hash = $marc->to_hash( $mfn, include_subfields => 1, );

It has ability to convert characters (using hash_filter) from MARC database before creating structures enabling character re-mapping or quick fix-up of data.

This function returns hash which is like this:

  '200' => [
             {
               'i1' => '1',
               'i2' => ' '
               'a' => 'Goa',
               'f' => 'Valdo D\'Arienzo',
               'e' => 'tipografie e tipografi nel XVI secolo',
             }
           ],

This method will also create additional field 000 with MFN.

to_ascii

  print $marc->to_ascii( 42 );

AUTHOR ^

        Dobrica Pavlinusic
        CPAN ID: DPAVLIN
        dpavlin@rot13.org
        http://www.rot13.org/~dpavlin/

COPYRIGHT ^

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

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO ^

Biblio::Isis, perl(1).