From e458676fa881ebaeaf3661d293275efed4219c6b Mon Sep 17 00:00:00 2001 From: Shawn Boyette Date: Tue, 5 Aug 2008 19:09:02 +0000 Subject: [PATCH] more cleanup and logic normalization --- fingerprints.pl | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/fingerprints.pl b/fingerprints.pl index 7f70da6..acc2e96 100755 --- a/fingerprints.pl +++ b/fingerprints.pl @@ -8,7 +8,7 @@ use MARC::File::XML ( BinaryEncoding => 'utf-8' ); use MARC::Field; use Unicode::Normalize; -my $count = 0; +my $count = 0; my $which = shift; my $id_tag = shift; my $id_subfield = shift; @@ -84,15 +84,11 @@ for my $file (@ARGV) { my $author; if ($record->field('100')) { $author = $record->field('100')->subfield('a'); } - if (! $author ) { - if ($record->field('110')) { - $author = $record->field('110')->subfield('a'); - } - } - if (! $author ) { - if ($record->field('111')) { - $author = $record->field('111')->subfield('a'); - } + unless ( $author ) { + $author = $record->field('110')->subfield('a') + if ($record->field('110')); + $author = $record->field('111')->subfield('a') + if ($record->field('111')); } my $desc = $record->field('300'); if ( $desc ) { $desc = $desc->subfield('a'); } @@ -149,20 +145,20 @@ for my $file (@ARGV) { foreach my $isbn ( @isbns ) { print STDOUT join("\t", $id, "case a", $item_form, $date1, - $record_type, $bib_lvl, $title,$isbn,$pages) + $record_type, $bib_lvl, $title, $isbn, $pages) ,"\n"; } } # case b : edition if ($edition) { print STDOUT - join("\t", $id, "case b", $item_form, $date1, + join("\t", $id, "case b", $item_form, $date1, $record_type, $bib_lvl, $title,$edition), "\n"; } # case c : issn if ($issn) { print STDOUT join("\t", $id, "case c", $item_form, $date1, - $record_type, $bib_lvl, $title,$issn) + $record_type, $bib_lvl, $title, $issn) ,"\n"; } # case d : lccn -- 1.7.2.5