r1075@llin: dpavlin | 2006-10-08 02:30:42 +0200
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 8 Oct 2006 00:38:04 +0000 (00:38 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 8 Oct 2006 00:38:04 +0000 (00:38 +0000)
 don't polute data_structure with leader (data_structure will now
 return undef as it should if matched rules didn't have any search
 or display directives)

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@741 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Normalize.pm

index ac8eb1f..e7cb23b 100644 (file)
@@ -164,7 +164,7 @@ Return hash formatted as data structure
 
 =cut
 
-my ($out, $marc_record, $marc_encoding, $marc_repeatable_subfield, $marc_indicators);
+my ($out, $marc_record, $marc_encoding, $marc_repeatable_subfield, $marc_indicators, $leader);
 my ($marc_record_offset, $marc_fetch_offset) = (0, 0);
 
 sub _get_ds {
@@ -181,7 +181,7 @@ Clean data structure hash for next record
 
 sub _clean_ds {
        my $a = {@_};
-       ($out,$marc_record, $marc_encoding, $marc_repeatable_subfield, $marc_indicators) = ();
+       ($out,$marc_record, $marc_encoding, $marc_repeatable_subfield, $marc_indicators, $leader) = ();
        ($marc_record_offset, $marc_fetch_offset) = (0,0);
        $marc_encoding = $a->{marc_encoding};
 }
@@ -487,9 +487,9 @@ sub marc_leader {
        my ($offset,$value) = @_;
 
        if ($offset) {
-               $out->{' leader'}->{ $offset } = $value;
+               $leader->{ $offset } = $value;
        } else {
-               return $out->{' leader'};
+               return $leader;
        }
 }