/[webpac2]/trunk/lib/WebPAC/Input.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Input.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 289 by dpavlin, Sun Dec 18 22:16:44 2005 UTC revision 307 by dpavlin, Tue Dec 20 00:03:04 2005 UTC
# Line 3  package WebPAC::Input; Line 3  package WebPAC::Input;
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
 use blib;  
   
6  use WebPAC::Common;  use WebPAC::Common;
7  use base qw/WebPAC::Common/;  use base qw/WebPAC::Common/;
8  use Text::Iconv;  use Text::Iconv;
# Line 100  sub new { Line 98  sub new {
98          foreach my $subclass (qw/open_db fetch_rec init/) {          foreach my $subclass (qw/open_db fetch_rec init/) {
99                  my $n = $self->{module} . '::' . $subclass;                  my $n = $self->{module} . '::' . $subclass;
100                  if (! defined &{ $n }) {                  if (! defined &{ $n }) {
101                          $log->logwarn("missing implementation of $subclass");                          my $missing = "missing $subclass in $self->{module}";
102                            $self->{$subclass} = sub { $log->logwarn($missing) };
103                  } else {                  } else {
104                          $self->{$subclass} = \&{ $n };                          $self->{$subclass} = \&{ $n };
105                  }                  }
# Line 175  sub open { Line 174  sub open {
174          my $code_page = $arg->{'code_page'} || '852';          my $code_page = $arg->{'code_page'} || '852';
175    
176          # store data in object          # store data in object
177          $self->{'code_page'} = $code_page;          $self->{'input_code_page'} = $code_page;
178          foreach my $v (qw/path offset limit/) {          foreach my $v (qw/path offset limit/) {
179                  $self->{$v} = $arg->{$v} if ($arg->{$v});                  $self->{$v} = $arg->{$v} if ($arg->{$v});
180          }          }
# Line 208  sub open { Line 207  sub open {
207          }          }
208    
209          if ($self->{limit}) {          if ($self->{limit}) {
210                  $log->info("limiting to ",$self->{limit}," records");                  $log->debug("limiting to ",$self->{limit}," records");
211                  $limit = $offset + $self->{limit} - 1;                  $limit = $offset + $self->{limit} - 1;
212                  $limit = $size if ($limit > $size);                  $limit = $size if ($limit > $size);
213          }          }

Legend:
Removed from v.289  
changed lines
  Added in v.307

  ViewVC Help
Powered by ViewVC 1.1.26