1 # This is slight modification of to_hash as included in Biblio::Isis
3 # This is incredibly bad (duplicate code), but it would have to wait for
4 # WebPac v2 to be fixed by extracting all file imported in sane OO way.
8 my $mfn = shift || confess "need mfn!";
9 my $row = shift || confess "need data";
11 # init record to include MFN as field 000
12 my $rec = { '000' => [ $mfn ] };
14 foreach my $k (keys %{$row}) {
15 foreach my $l (@{$row->{$k}}) {
20 #($val->{'i1'},$val->{'i2'}) = ($1,$2) if ($l =~ s/^([01 #])([01 #])\^/\^/);
23 if ($l =~ m/[\^\$]/) {
24 foreach my $t (split(/[\^\$]/,$l)) {
26 $val->{substr($t,0,1)} = substr($t,1);
32 push @{$rec->{$k}}, $val;