--- branches/ffzg/all2xml.pl 2006/06/06 12:35:31 748 +++ branches/ffzg/all2xml.pl 2008/08/03 06:33:56 776 @@ -1,16 +1,16 @@ #!/usr/bin/perl -w use strict; -use Biblio::Isis; +use Biblio::Isis 0.23; use Getopt::Std; use Data::Dumper; use XML::Simple; use Text::Iconv; use Config::IniFiles; use Encode; -#use GDBM_File; +use GDBM_File; use Fcntl; # for O_RDWR -use TDB_File; +#use TDB_File; use Carp; $|=1; @@ -72,7 +72,7 @@ my %lhash; # this option will cache all lookup entries in memory. # if you are tight on memory, turn this off -my $use_lhash_cache = 1; +my $use_lhash_cache = 0; my $last_field_name; # cache to prevent repeated fields @@ -673,12 +673,12 @@ # create new lookup file my $lookup_file = $cfg -> val($database, 'lookup_newfile'); # optional if ($lookup_file) { - #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644; if (! -e $lookup_file) { open(LOOKUP, "> $lookup_file") || die "can't create $lookup_file': $!"; close(LOOKUP); } - tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644; + tie %lhash, 'GDBM_File', $lookup_file, &GDBM_NEWDB, 0644; + #tie %lhash, 'TDB_File', $lookup_file, TDB_CLEAR_IF_FIRST, O_RDWR, 0644; print STDERR "creating lookup file '$lookup_file'\n"; # delete memory cache for lookup file delete $cache->{lhash}; @@ -687,8 +687,8 @@ # open existing lookup file $lookup_file = $cfg -> val($database, 'lookup_open'); # optional if ($lookup_file) { - #tie %lhash, 'GDBM_File', $lookup_file, &GDBM_READER, 0644; - tie %lhash, 'TDB_File', $lookup_file, TDB_DEFAULT, O_RDWR, 0644; + tie %lhash, 'GDBM_File', $lookup_file, &GDBM_READER, 0644; + #tie %lhash, 'TDB_File', $lookup_file, TDB_DEFAULT, O_RDWR, 0644; print STDERR "opening lookup file '$lookup_file'\n"; } @@ -785,7 +785,10 @@ my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!"; $import2cp = Text::Iconv->new($config->{isis_codepage},$codepage); - my $db = new Biblio::Isis( isisdb => $isis_db ) || next; + my $db = new Biblio::Isis( + isisdb => $isis_db, + join_subfields_with => ' ; ', + ); if (! $db) { print STDERR "FATAL: can't read ISIS database: $isis_db, skipping...\n"; @@ -1044,6 +1047,7 @@ # call this to commit index $index->close; +warn "index closed, exiting...\n"; 1; __END__