The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MARC::Lint::CodeData -- Contains codes from the MARC code lists for Geographic Areas, Languages, and Countries.

Code data is used for validating fields 008, 040, 041, and 043.

Stores codes in hashes, %MARC::Lint::CodeData::[name].

SYNOPSIS

use MARC::Lint::CodeData;

#Should provide access to the following: #%MARC::Lint::CodeData::GeogAreaCodes; #%MARC::Lint::CodeData::ObsoleteGeogAreaCodes; #%MARC::Lint::CodeData::LanguageCodes; #%MARC::Lint::CodeData::ObsoleteLanguageCodes; #%MARC::Lint::CodeData::CountryCodes #%MARC::Lint::CodeData::ObsoleteCountryCodes

#or, import specific code list data use MARC::Lint::CodeData qw(%GeogAreaCodes);

my $gac = "n-us---"; my $validgac = 1 if ($GeogAreaCodes{$gac}); print "Geographic Area Code $gac is valid\n" if $validgac;

EXPORT

None by default. @EXPORT_OK: %GeogAreaCodes, %ObsoleteGeogAreaCodes, %LanguageCodes, %ObsoleteLanguageCodes, %CountryCodes, %ObsoleteCountryCodes.

TO DO

Update codes as needed (see http://www.loc.gov/marc/).

Add codes for MARC Code Lists for Relators, Sources, Description Conventions.

Determine whether three blank spaces should be in the LanguageCodes (for 008 validation) or not. If it is here, then 041 would be allowed to have three blank spaces as a valid code (though other checks would report the error--spaces at the beginning and ending of a subfield and multiple spaces in a field where such a thing is not allowed).

SEE ALSO

MARC::Lint

MARC::Lintadditions (for check_040, check_041, check_043 using these codes)

MARC::Errorchecks (for 008 validation using these codes)

http://www.loc.gov/marc/ for the official code lists.

The following (should be included in the distribution package for this package): countrycodelistclean.pl gaccleanupscript.pl languagecodelistclean.pl The scripts above take the MARC code list ASCII version as input. They output tab-separated codes for updating the data below.

VERSION HISTORY

Version 1.00 (original version): First release, Dec. 5, 2004. -Included in MARC::Errorchecks distribution on CPAN. -Used by MARC::Lintadditions.

LICENSE

This code may be distributed under the same terms as Perl itself.

Please note that this module is not a product of or supported by the employers of the various contributors to the code.

AUTHOR

Bryan Baldus eijabb@cpan.org

Copyright (c) 2004.