--- trunk/lib/WebPAC/Input.pm 2005/12/18 22:16:44 289 +++ trunk/lib/WebPAC/Input.pm 2005/12/20 19:01:22 308 @@ -3,11 +3,10 @@ use warnings; use strict; -use blib; - use WebPAC::Common; use base qw/WebPAC::Common/; use Text::Iconv; +use Data::Dumper; =head1 NAME @@ -100,7 +99,8 @@ foreach my $subclass (qw/open_db fetch_rec init/) { my $n = $self->{module} . '::' . $subclass; if (! defined &{ $n }) { - $log->logwarn("missing implementation of $subclass"); + my $missing = "missing $subclass in $self->{module}"; + $self->{$subclass} = sub { $log->logwarn($missing) }; } else { $self->{$subclass} = \&{ $n }; } @@ -175,7 +175,7 @@ my $code_page = $arg->{'code_page'} || '852'; # store data in object - $self->{'code_page'} = $code_page; + $self->{'input_code_page'} = $code_page; foreach my $v (qw/path offset limit/) { $self->{$v} = $arg->{$v} if ($arg->{$v}); } @@ -208,7 +208,7 @@ } if ($self->{limit}) { - $log->info("limiting to ",$self->{limit}," records"); + $log->debug("limiting to ",$self->{limit}," records"); $limit = $offset + $self->{limit} - 1; $limit = $size if ($limit > $size); } @@ -225,6 +225,8 @@ my $rec = $self->{fetch_rec}->($self, $db, $pos ); + $log->debug(sub { Dumper($rec) }); + if (! $rec) { $log->warn("record $pos empty? skipping..."); next;