convert repeatable fileds into repeatable subfields
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2005 16:33:09 +0000 (16:33 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 8 Oct 2005 16:33:09 +0000 (16:33 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@5 49f9634a-d7ec-0310-8e6b-ec35c6cc8804

Changes
Fast.pm

diff --git a/Changes b/Changes
index e4867d8..be97c42 100644 (file)
--- a/Changes
+++ b/Changes
@@ -3,4 +3,7 @@ Revision history for Perl module MARC::Fast
 0.01 Sun Jan  2 03:42:23 2005
        - original version; created by ExtUtils::ModuleMaker 0.32
 
 0.01 Sun Jan  2 03:42:23 2005
        - original version; created by ExtUtils::ModuleMaker 0.32
 
+0.02 Sat Oct  8 17:57:37 CEST 2005
+       - convert repeatable fileds into repeatable subfields
+         900^afoo and 900^abar -> 900^afoo^abar
 
 
diff --git a/Fast.pm b/Fast.pm
index 50e43cc..9a981be 100644 (file)
--- a/Fast.pm
+++ b/Fast.pm
@@ -7,7 +7,7 @@ use Data::Dumper;
 BEGIN {
        use Exporter ();
        use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 BEGIN {
        use Exporter ();
        use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-       $VERSION     = 0.01;
+       $VERSION     = 0.02;
        @ISA         = qw (Exporter);
        #Give a hoot don't pollute, do not export more than needed by default
        @EXPORT      = qw ();
        @ISA         = qw (Exporter);
        #Give a hoot don't pollute, do not export more than needed by default
        @EXPORT      = qw ();
@@ -196,7 +196,11 @@ sub fetch {
                my $f = substr($fields,$addr,$len);
                print STDERR "tag/len/addr $tag [$len] $addr: '$f'\n" if ($self->{debug});
 
                my $f = substr($fields,$addr,$len);
                print STDERR "tag/len/addr $tag [$len] $addr: '$f'\n" if ($self->{debug});
 
-               $row->{$tag} = $f;
+               if ($row->{$tag}) {
+                       $row->{$tag} .= $f;
+               } else {
+                       $row->{$tag} = $f;
+               }
 
                my $del = substr($fields,$addr+$len-1,1);
 
 
                my $del = substr($fields,$addr+$len-1,1);