573 |
|
|
574 |
foreach my $d (@$r) { |
foreach my $d (@$r) { |
575 |
|
|
576 |
|
if ( ! ref($d) ) { |
577 |
|
# scalar |
578 |
|
warn "## marc_original_order($to,$from) skipped: ",dump( $d ); |
579 |
|
next; |
580 |
|
} |
581 |
|
|
582 |
if (! defined($d->{subfields}) && ref($d->{subfields}) ne 'ARRAY') { |
if (! defined($d->{subfields}) && ref($d->{subfields}) ne 'ARRAY') { |
583 |
warn "# marc_original_order($to,$from): field $from doesn't have subfields specification\n"; |
warn "# marc_original_order($to,$from): field $from doesn't have subfields specification\n"; |
584 |
next; |
next; |
604 |
} elsif ($offset == 0) { |
} elsif ($offset == 0) { |
605 |
$v = $d->{$sf}; |
$v = $d->{$sf}; |
606 |
} else { |
} else { |
607 |
die "field $from subfield '$sf' need occurence $offset which doesn't exist", dump($d->{$sf}); |
die "field $from subfield '$sf' need occurence $offset which doesn't exist in ", dump($d); |
608 |
} |
} |
609 |
push @$m, ( $sf, $v ) if (defined($v)); |
push @$m, ( $sf, $v ) if (defined($v)); |
610 |
} |
} |
639 |
=cut |
=cut |
640 |
|
|
641 |
sub marc_clone { |
sub marc_clone { |
642 |
|
warn "### marc_clone rec: ",dump( $rec ) if $debug > 2; |
643 |
foreach my $f ( keys %$rec ) { |
foreach my $f ( keys %$rec ) { |
644 |
warn "## marc_clone $f\n" if $debug; |
warn "## marc_clone $f\n" if $debug; |
645 |
marc_original_order( $f, $f ); |
marc_original_order( $f, $f ); |