/[webpac2]/trunk/lib/WebPAC/Normalize.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.pm

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

revision 819 by dpavlin, Wed Apr 11 10:09:34 2007 UTC revision 889 by dpavlin, Thu Sep 6 19:12:15 2007 UTC
# Line 535  sub marc_fixed { Line 535  sub marc_fixed {
535          my ($f, $pos, $val) = @_;          my ($f, $pos, $val) = @_;
536          die "need marc(field, position, value)" unless defined($f) && defined($pos);          die "need marc(field, position, value)" unless defined($f) && defined($pos);
537    
538            confess "need val" unless defined $val;
539    
540          my $update = 0;          my $update = 0;
541    
542          map {          map {
543                  if ($_->[0] eq $f) {                  if ($_->[0] eq $f) {
544                          my $old = $_->[1];                          my $old = $_->[1];
545                          if (length($old) < $pos) {                          if (length($old) <= $pos) {
546                                  $_->[1] .= ' ' x ( $pos - length($old) ) . $val;                                  $_->[1] .= ' ' x ( $pos - length($old) ) . $val;
547                                  warn "## marc_fixed($f,$pos,'$val') append '$old' -> '$_->[1]'\n" if ($debug > 1);                                  warn "## marc_fixed($f,$pos,'$val') append '$old' -> '$_->[1]'\n" if ($debug > 1);
548                          } else {                          } else {
# Line 872  sub _pack_subfields_hash { Line 874  sub _pack_subfields_hash {
874    
875          my ($h,$include_subfields) = @_;          my ($h,$include_subfields) = @_;
876    
877            # sanity and ease of use
878            return $h if (ref($h) ne 'HASH');
879    
880          if ( defined($h->{subfields}) ) {          if ( defined($h->{subfields}) ) {
881                  my $sfs = delete $h->{subfields} || die "no subfields?";                  my $sfs = delete $h->{subfields} || die "no subfields?";
882                  my @out;                  my @out;

Legend:
Removed from v.819  
changed lines
  Added in v.889

  ViewVC Help
Powered by ViewVC 1.1.26