--- trunk/lib/Biblio/Isis.pm 2006/07/06 20:31:46 45 +++ trunk/lib/Biblio/Isis.pm 2006/07/07 21:11:01 50 @@ -7,7 +7,7 @@ BEGIN { use Exporter (); use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - $VERSION = 0.14; + $VERSION = 0.20; @ISA = qw (Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw (); @@ -464,6 +464,13 @@ } ], +In case there are repeatable subfields in record, this will create +following structure: + + '900' => [ { + 'a' => [ 'foo', 'bar', 'baz' ], + }] + This method will also create additional field C<000> with MFN. =cut @@ -496,7 +503,16 @@ if ($l =~ m/\^/) { foreach my $t (split(/\^/,$l)) { next if (! $t); - $val->{substr($t,0,1)} = substr($t,1); + my ($sf,$v) = (substr($t,0,1), substr($t,1)); + warn "### $k^$sf:$v",$/ if ($self->{debug} > 1); + if (ref( $val->{$sf} ) eq 'ARRAY') { + push @{ $val->{$sf} }, $v; + } elsif (defined( $val->{$sf} )) { + # convert scalar field to array + $val->{$sf} = [ $val->{$sf}, $v ]; + } else { + $val->{$sf} = $v; + } } } else { $val = $l;