+=head2 to_hash
+
+Read mfn and convert it to hash
+
+ my $hash = $isis->to_hash($mfn);
+
+It has ability to convert characters (using C<hash_filter> from ISIS
+database before creating structures enabling character remapping or quick
+fixup of data.
+
+This function returns hash which is like this:
+
+ $hash = {
+ '210' => [
+ {
+ 'c' => 'New York University press',
+ 'a' => 'New York',
+ 'd' => 'cop. 1988'
+ }
+ ],
+ '990' => [
+ '2140',
+ '88',
+ 'HAY'
+ ],
+ };
+
+You can later use that has to produce any output from ISIS data.
+
+=cut
+
+sub to_hash {
+ my $self = shift;
+
+ my $mfn = shift || confess "need mfn!";
+
+ my $rec;
+ my $row = $self->fetch($mfn);
+
+ foreach my $k (keys %{$row}) {
+ foreach my $l (@{$row->{$k}}) {
+
+ # filter output
+ $l = $self->{'hash_filter'}->($l) if ($self->{'hash_filter'});
+
+ # has subfields?
+ my $val;
+ if ($l =~ m/\^/) {
+ foreach my $t (split(/\^/,$l)) {
+ next if (! $t);
+ $val->{substr($t,0,1)} = substr($t,1);
+ }
+ } else {
+ $val = $l;
+ }
+
+ push @{$rec->{$k}}, $val;
+ }
+ }
+
+ return $rec;
+}
+