+ my $leader = $input->param('leader');
+
+ my $material_configuration;
+ if ($leader && length($leader) == '24') {
+ #MARC 21 Material Type Configuration
+ #Field 008/18-34 Configuration
+ #If Leader/06 = a and Leader/07 = a, c, d, or m: Books
+ #If Leader/06 = a and Leader/07 = b, i, or s: Continuing Resources
+ #If Leader/06 = t: Books
+ #If Leader/06 = c, d, i, or j: Music
+ #If Leader/06 = e, or f: Maps
+ #If Leader/06 = g, k, o, or r: Visual Materials
+ #If Leader/06 = m: Computer Files
+ #If Leader/06 = p: Mixed Materials
+ #http://www.loc.gov/marc/bibliographic/bdleader.html
+ my $material_configuration_mapping = {
+ a => {
+ a => 'BKS',
+ c => 'BKS',
+ d => 'BKS',
+ m => 'BKS',
+ b => 'CR',
+ i => 'CR',
+ s => 'CR',
+ },
+ t => 'BKS',
+ c => 'MU',
+ d => 'MU',
+ i => 'MU',
+ j => 'MU',
+ e => 'MP',
+ f => 'MP',
+ g => 'VM',
+ k => 'VM',
+ o => 'VM',
+ r => 'VM',
+ m => 'CF',
+ p => 'MX',
+ };
+ my $leader06 = substr($leader, 6, 1);
+ my $leader07 = substr($leader, 7, 1);
+ #Retrieve material type using leader06
+ $material_configuration = $material_configuration_mapping->{$leader06};
+ #If the value returned is a ref (i.e. leader06 is 'a'), then use leader07 to get the actual material type
+ if ( ($material_configuration) && (ref($material_configuration) eq 'HASH') ){
+ $material_configuration = $material_configuration->{$leader07};
+ }
+ }