6 |
marc_duplicate marc_remove marc_count |
marc_duplicate marc_remove marc_count |
7 |
marc_original_order |
marc_original_order |
8 |
marc_template |
marc_template |
9 |
|
marc_clone |
10 |
/; |
/; |
11 |
|
|
12 |
use strict; |
use strict; |
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 |
} |
} |
630 |
return $#{ $marc_record }; |
return $#{ $marc_record }; |
631 |
} |
} |
632 |
|
|
633 |
|
=head2 marc_clone |
634 |
|
|
635 |
|
Clone marc records from input file, whole or just some fields/indicators |
636 |
|
|
637 |
|
marc_clone; # whole record |
638 |
|
|
639 |
|
=cut |
640 |
|
|
641 |
|
sub marc_clone { |
642 |
|
warn "### marc_clone rec: ",dump( $rec ) if $debug > 2; |
643 |
|
foreach my $f ( keys %$rec ) { |
644 |
|
warn "## marc_clone $f\n" if $debug; |
645 |
|
marc_original_order( $f, $f ); |
646 |
|
} |
647 |
|
} |
648 |
|
|
649 |
=head1 PRIVATE FUNCTIONS |
=head1 PRIVATE FUNCTIONS |
650 |
|
|
651 |
=head2 _marc_push |
=head2 _marc_push |