--- trunk/all2xml.pl 2003/03/22 22:43:05 43 +++ trunk/all2xml.pl 2003/06/01 13:46:42 50 @@ -19,8 +19,7 @@ my $config; use index_DBI; # there is no other, right now ;-) - -my $index = new index_DBI(); # open index +my $index; my %opts; @@ -214,6 +213,17 @@ my $cfg = new Config::IniFiles( -file => $config_file ); +# open index +$index = new index_DBI( + $cfg->val('global', 'dbi_dbd'), + $cfg->val('global', 'dbi_dsn'), + $cfg->val('global', 'dbi_user'), + $cfg->val('global', 'dbi_passwd') || '', + ); + +# delete [global] section to leave just databases sections +$cfg->DeleteSection('global'); + foreach my $database ($cfg->Sections) { my $isis_db = $cfg -> val($database, 'isis_db') || die "$database doesn't have 'isis_db' defined!"; @@ -254,7 +264,8 @@ my $swishpath = $path."#".int($row->{mfn}); - if (my $xml = $cp2utf->convert(isis2xml($row,$add_xml."$swishpath"))) { + if (my $xml = isis2xml($row,$add_xml)) { + $xml = $cp2utf->convert($xml); use bytes; # as opposed to chars print "Path-Name: $swishpath\n"; print "Content-Length: ".(length($xml)+1)."\n";