/[webpac2]/trunk/lib/WebPAC/Normalize/MARC.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Normalize/MARC.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1110 by dpavlin, Sat Sep 6 09:54:08 2008 UTC revision 1111 by dpavlin, Sat Sep 6 10:54:25 2008 UTC
# Line 573  sub marc_original_order { Line 573  sub marc_original_order {
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;
# Line 598  sub marc_original_order { Line 604  sub marc_original_order {
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                  }                  }
# Line 633  Clone marc records from input file, whol Line 639  Clone marc records from input file, whol
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 );

Legend:
Removed from v.1110  
changed lines
  Added in v.1111

  ViewVC Help
Powered by ViewVC 1.1.26