NAME
MARC::File::USMARC - USMARC-specific file handling
VERSION
Version 1.16
$Id: USMARC.pm,v 1.34 2003/01/28 21:41:40 petdance Exp $
SYNOPSIS
use MARC::File::USMARC;
my $file = MARC::File::USMARC::in( $filename );
while ( my $marc = $file->next() ) {
# Do something
}
$file->close();
undef $file;
EXPORT
None.
METHODS
Internal function to get the next raw record out of a file.
decode()
Constructor for handling data from a USMARC file. This function takes care of all the tag directory parsing & mangling.
Any warnings or coercions can be checked in the warnings()
function.
update_leader()
If any changes get made to the MARC record, the first 5 bytes of the leader (the length) will be invalid. This function updates the leader with the correct length of the record as it would be if written out to a file.
_build_tag_directory()
Function for internal use only: Builds the tag directory that gets put in front of the data in a MARC record.
Returns two array references, and two lengths: The tag directory, and the data fields themselves, the length of all data (including the Leader that we expect will be added), and the size of the Leader and tag directory.
encode()
Returns a string of characters suitable for writing out to a USMARC file, including the leader, directory and all the fields.
RELATED MODULES
TODO
Make some sort of autodispatch so that you don't have to explicitly specify the MARC::File::X subclass, sort of like how DBI knows to use DBD::Oracle or DBD::Mysql.
LICENSE
This code may be distributed under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
AUTHOR
Andy Lester, <marc@petdance.com> or <alester@flr.follett.com>