X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=Equinox-Migration%2Flib%2FEquinox%2FMigration%2FMapDrivenMARCXMLProc.pm;h=ca82ca7e6328c6a17b48de26f1216a791a64cd30;hp=8db9e7eef27fde2684240486b6d90b1b17a67004;hb=d1d70c501f6592ae84fc351e4325e5a5f9a67376;hpb=f79126d237f658b9f09f28a19bdb7d57e7b327c6 diff --git a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm index 8db9e7e..ca82ca7 100644 --- a/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm +++ b/Equinox-Migration/lib/Equinox/Migration/MapDrivenMARCXMLProc.pm @@ -4,7 +4,6 @@ use warnings; use strict; use XML::Twig; -use DBM::Deep; use Equinox::Migration::SubfieldMapper 1.004; @@ -14,11 +13,11 @@ Equinox::Migration::MapDrivenMARCXMLProc =head1 VERSION -Version 1.002 +Version 1.004 =cut -our $VERSION = '1.002'; +our $VERSION = '1.004'; my $dstore; my $sfmap; @@ -63,12 +62,7 @@ sub new { mods => \@mods ); # initialize datastore - die "Datastore file 'EMMXSSTORAGE.dbmd' already exists. Exiting.\n" - if (-e "EMMXSSTORAGE.dbmd"); - $dstore = DBM::Deep->new( file => "EMMXSSTORAGE.dbmd", - data_sector_size => 256, - autoflush => 0, - ); + $dstore = {}; $reccount = 0; # next record ptr $dstore->{tags} = $sfmap->tags; # list of all tags $self->{data} = $dstore; @@ -85,8 +79,6 @@ sub new { return $self; } -sub DESTROY { unlink "EMMXSSTORAGE.dbmd" } - =head2 parse_record Extracts data from the next record, per the mapping file. @@ -106,7 +98,7 @@ sub parse_record { $reccount++; # check for required fields - check_required(); + check_required($crec); push @{ $dstore->{recs} }, $crec; print STDERR "$reccount\n" @@ -186,8 +178,8 @@ sub process_subs { sub check_required { + my ($crec) = @_; my $mods = $sfmap->mods; - my $crec = $dstore->{crec}; for my $tag_id (keys %{$mods->{required}}) { for my $code (@{$mods->{required}{$tag_id}}) {