9 |
|
|
10 |
use WebPAC::Common 0.02; |
use WebPAC::Common 0.02; |
11 |
use WebPAC::Lookup; |
use WebPAC::Lookup; |
12 |
use WebPAC::Input::ISIS 0.02; |
use WebPAC::Input 0.03; |
13 |
use WebPAC::Store 0.03; |
use WebPAC::Store 0.03; |
14 |
use WebPAC::Normalize::XML; |
use WebPAC::Normalize::XML; |
15 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
90 |
|
|
91 |
$log->info("working on input $input->{path} [$input->{type}] using $input_module"); |
$log->info("working on input $input->{path} [$input->{type}] using $input_module"); |
92 |
|
|
93 |
sub new_input { |
my $input_db = new WebPAC::Input( |
94 |
my $name = shift; |
module => $input_module, |
|
my $args = shift; |
|
|
new $name->($args); |
|
|
} |
|
|
|
|
|
my $input = new_input($input_module,{ |
|
95 |
code_page => $config->{webpac}->{webpac_encoding}, |
code_page => $config->{webpac}->{webpac_encoding}, |
96 |
limit_mfn => $input->{limit}, |
limit_mfn => $input->{limit}, |
97 |
lookup => $lookup, |
lookup => $lookup, |
98 |
}); |
); |
99 |
$log->logdie("can't create input using $input_module") unless ($input); |
$log->logdie("can't create input using $input_module") unless ($input); |
100 |
|
|
101 |
my $maxmfn = $input->open( |
my $maxmfn = $input_db->open( |
102 |
path => $input->{path}, |
path => $input->{path}, |
103 |
code_page => $input->{encoding}, # database encoding |
code_page => $input->{encoding}, # database encoding |
104 |
); |
); |
125 |
); |
); |
126 |
} |
} |
127 |
|
|
128 |
for ( 0 ... $input->size ) { |
for ( 0 ... $input_db->size ) { |
129 |
|
|
130 |
my $row = $input->fetch || next; |
my $row = $input_db->fetch || next; |
131 |
|
|
132 |
my $mfn = $row->{'000'}->[0] || die "can't find MFN"; |
my $mfn = $row->{'000'}->[0] || die "can't find MFN"; |
133 |
|
|