193 |
# first, sort all existing fields |
# first, sort all existing fields |
194 |
# XXX might not be needed, but modern perl might randomize elements in hash |
# XXX might not be needed, but modern perl might randomize elements in hash |
195 |
my @sorted_marc_record = sort { |
my @sorted_marc_record = sort { |
196 |
$a->[0] . $a->[3] cmp $b->[0] . $b->[3] |
$a->[0] . ( $a->[3] || '' ) cmp $b->[0] . ( $b->[3] || '') |
197 |
} @{ $marc_record }; |
} @{ $marc_record }; |
198 |
|
|
199 |
@sorted_marc_record = @{ $marc_record }; ### FIXME disable sorting |
@sorted_marc_record = @{ $marc_record }; ### FIXME disable sorting |
203 |
|
|
204 |
# count unique field-subfields (used for offset when walking to next subfield) |
# count unique field-subfields (used for offset when walking to next subfield) |
205 |
my $u; |
my $u; |
206 |
map { $u->{ $_->[0] . $_->[3] }++ } @sorted_marc_record; |
map { $u->{ $_->[0] . ( $_->[3] || '') }++ } @sorted_marc_record; |
207 |
|
|
208 |
if ($debug) { |
if ($debug) { |
209 |
warn "## marc_repeatable_subfield ", dump( $marc_repeatable_subfield ), $/; |
warn "## marc_repeatable_subfield ", dump( $marc_repeatable_subfield ), $/; |
231 |
|
|
232 |
# field and subfield which is key for |
# field and subfield which is key for |
233 |
# marc_repeatable_subfield and u |
# marc_repeatable_subfield and u |
234 |
my $fsf = $row->[0] . $row->[3]; |
my $fsf = $row->[0] . ( $row->[3] || '' ); |
235 |
|
|
236 |
if ($debug > 1) { |
if ($debug > 1) { |
237 |
|
|