$log->info("processing $self->{size} records in $code_page, convert to $self->{code_page}");
# read database
- for (my $pos = $offset; $pos <= $limit; $mfn++) {
+ for (my $pos = $offset; $pos <= $limit; $pos++) {
$log->debug("position: $pos\n");
use WebPAC::Common 0.02;
use WebPAC::Lookup;
-use WebPAC::Input::ISIS 0.02;
+use WebPAC::Input 0.03;
use WebPAC::Store 0.03;
use WebPAC::Normalize::XML;
use WebPAC::Output::TT;
$log->info("working on input $input->{path} [$input->{type}] using $input_module");
- sub new_input {
- my $name = shift;
- my $args = shift;
- new $name->($args);
- }
-
- my $input = new_input($input_module,{
+ my $input_db = new WebPAC::Input(
+ module => $input_module,
code_page => $config->{webpac}->{webpac_encoding},
limit_mfn => $input->{limit},
lookup => $lookup,
- });
+ );
$log->logdie("can't create input using $input_module") unless ($input);
- my $maxmfn = $input->open(
+ my $maxmfn = $input_db->open(
path => $input->{path},
code_page => $input->{encoding}, # database encoding
);
);
}
- for ( 0 ... $input->size ) {
+ for ( 0 ... $input_db->size ) {
- my $row = $input->fetch || next;
+ my $row = $input_db->fetch || next;
my $mfn = $row->{'000'}->[0] || die "can't find MFN";