Lines 388-394
sub print_typetag {
Link Here
|
388 |
); |
388 |
); |
389 |
|
389 |
|
390 |
## The type of a MARC record is found at position 06 of the leader |
390 |
## The type of a MARC record is found at position 06 of the leader |
391 |
my $typeofrecord = substr($leader, 6, 1); |
391 |
my $typeofrecord = defined($leader) && length $leader >=6 ? |
|
|
392 |
substr($leader, 6, 1): undef; |
392 |
|
393 |
|
393 |
## ToDo: for books, field 008 positions 24-27 might have a few more |
394 |
## ToDo: for books, field 008 positions 24-27 might have a few more |
394 |
## hints |
395 |
## hints |
Lines 396-402
sub print_typetag {
Link Here
|
396 |
my %typehash; |
397 |
my %typehash; |
397 |
|
398 |
|
398 |
## the ukmarc here is just a guess |
399 |
## the ukmarc here is just a guess |
399 |
if ($intype eq "marc21" || $intype eq "ukmarc") { |
400 |
if (! defined $intype) { |
|
|
401 |
## assume MARC21 as default |
402 |
%typehash = %ustypehash; |
403 |
} |
404 |
elsif ($intype eq "marc21" || $intype eq "ukmarc") { |
400 |
%typehash = %ustypehash; |
405 |
%typehash = %ustypehash; |
401 |
} |
406 |
} |
402 |
elsif ($intype eq "unimarc") { |
407 |
elsif ($intype eq "unimarc") { |
Lines 407-413
sub print_typetag {
Link Here
|
407 |
%typehash = %ustypehash; |
412 |
%typehash = %ustypehash; |
408 |
} |
413 |
} |
409 |
|
414 |
|
410 |
if (!exists $typehash{$typeofrecord}) { |
415 |
if (!defined $typeofrecord || !exists $typehash{$typeofrecord}) { |
411 |
print "TY - BOOK\r\n"; ## most reasonable default |
416 |
print "TY - BOOK\r\n"; ## most reasonable default |
412 |
warn ("no type found - assume BOOK") if $marcprint; |
417 |
warn ("no type found - assume BOOK") if $marcprint; |
413 |
} |
418 |
} |
414 |
- |
|
|