--- trunk/lib/WebPAC/Normalize.pm 2007/11/09 23:41:39 1017 +++ trunk/lib/WebPAC/Normalize.pm 2007/11/10 00:05:36 1019 @@ -933,9 +933,11 @@ my ( $new_r, $from_count, $to_count ); foreach my $sf ( keys %{$r} ) { + # skip everything which isn't one char subfield (e.g. 'subfields') + next unless $sf =~ m/^\w$/; my $nr = $from_count->{$sf}++; - my $rename_to = $subfields_rename->{ $sf }; # || -# die "can't find subfield rename for $sf/$nr in ", dump( $subfields_rename ); + my $rename_to = $subfields_rename->{ $sf } || + die "can't find subfield rename for $sf/$nr in ", dump( $subfields_rename ); warn "### rename $sf/$nr to ", dump( $rename_to->[$nr] ), $/; my ( $to_sf, $to_nr ) = @{ $rename_to->[$nr] }; $new_r->{ $to_sf }->[ $to_nr ] = [ $sf => $nr ]; @@ -957,7 +959,10 @@ $fill_in = {}; - foreach my $sf ( split(/\|/, $template ) ) { + my @templates = split(/\|/, $template ); + @templates = ( $template ); + + foreach my $sf ( @templates ) { sub fill_in { my ( $r, $sf, $nr ) = @_; my ( $from_sf, $from_nr ) = @{ $new_r->{ $sf }->[ $nr ] };