--- trunk2/lib/WebPAC.pm 2004/09/15 16:51:24 447 +++ trunk2/lib/WebPAC.pm 2004/09/15 16:53:51 448 @@ -209,6 +209,8 @@ if (my $s = $self->{'start_mfn'}) { $log->info("skipping to MFN $s"); $startmfn = $s; + } else { + $self->{'start_mfn'} = $startmfn; } $maxmfn = $startmfn + $self->{limit_mfn} if ($self->{limit_mfn}); @@ -264,7 +266,7 @@ } - $self->{'current_mfn'} = $startmfn; + $self->{'current_mfn'} = -1; $self->{'last_pcnt'} = 0; $log->debug("max mfn: $maxmfn"); @@ -287,7 +289,15 @@ my $log = $self->_get_logger(); - my $mfn = $self->{'current_mfn'}++ || $log->logconfess("it seems that you didn't load database!"); + $log->logconfess("it seems that you didn't load database!") unless ($self->{'current_mfn'}); + + if ($self->{'current_mfn'} == -1) { + $self->{'current_mfn'} = $self->{'start_mfn'}; + } else { + $self->{'current_mfn'}++; + } + + my $mfn = $self->{'current_mfn'}; if ($mfn > $self->{'max_mfn'}) { $self->{'current_mfn'} = $self->{'max_mfn'}; @@ -304,6 +314,19 @@ } } +=head2 mfn + +Returns current record number (MFN). + + print $webpac->mfn; + +=cut + +sub mfn { + my $self = shift; + return $self->{'current_mfn'}; +} + =head2 progress_bar Draw progress bar on STDERR.