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::Descriptions - MARC metadata looker-upper

SYNOPSIS

use MARC::Descriptions

my $TD = MARC::Descriptions->new;

# hash of all tag data
my $href = $TD->get("245");

# string description
my $s = $TD->get("245", "description");

# hash of all subfields
my $href = $TD->get("245", "subfield");

# hash of subfield 'a'
my $href = $TD->get("245", "subfield", "a");

# description of subfield 'a'
my $s = $TD->get("245", "subfield", "a", "description");

DESCRIPTION

MARC::Description allows you to get either a string of information about a particular bit of a MARC record (eg: the description of the 245 tag, or the flags associated with tag 245 subfield \$a), or a hash of (hashes of) strings of information about a particular subset of a MARC record (eg: all of the 2nd indicators for tag 245, or all of the subfields for tag 245, or even a complete breakdown of tag 245).

CONSTRUCTOR

new()

Creates the MARC::Descriptions object. You only ever need one of these; all of the fun stuff is done in get().

METHODS

get( $tag [, $parm1 [, $parm2 [, $parm3]]] )

Returns information about the MARC structure.

tag is the MARC tag
   eg: get("010")
   With no other parameters, this returns a hash of all information
   about that tag.

parm1 can be one of:
   "description","shortname", or "flags" (eg: get("245","description")),
      in which case a string is returned with that information,
  or
   "ind1","ind2","subfield" (eg: get("245","subfield")),
      in which case parm2 will be the indicator/subfield that you're
      interested in, and get() will return a hash of the information
      about all possible indicators or subfields.

If both parm1 and parm2 are specified, then parm3 can also be specified
   to have get() return a string containing information about that particular
   indicator/subfield.  (eg: get("245","subfield","a"))

THE HASH

If you've asked get() to return a hash, it will look like this (or a subset of this) - the example is for get("010"):

 {
 flags => "",
 shortname => "LCCN",
 description => "Library of Congress Control Number",
 ind1 => {
	"#" => {
		flags => "",
		description => "Unused",
		},
	},
 ind2 => {
	"#" => {
		flags => "",
		description => "Blank",
		},
	},
 subfield => {
	"a" => {
		flags => "",
		description => "LC control number",
		},
	"b" => {
		flags => "aR",
		description => "National Union Catalog of Manuscript Collections Control Number",
		},
	"z" => {
		flags => "R",
		description => "Canceled/invalid LC control number",
		},
	},
 }

SEE ALSO

AUTHOR

David Christensen, <DChristensenSPAMLESS@westman.wave.ca>

COPYRIGHT AND LICENSE

Copyright 2003 by David Christensen

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