/[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 636 by dpavlin, Wed Sep 6 19:25:22 2006 UTC revision 652 by dpavlin, Thu Sep 7 15:01:45 2006 UTC
# Line 107  sub new { Line 107  sub new {
107          #eval $self->{module} .'->import';          #eval $self->{module} .'->import';
108    
109          # check if required subclasses are implemented          # check if required subclasses are implemented
110          foreach my $subclass (qw/open_db fetch_rec init/) {          foreach my $subclass (qw/open_db fetch_rec init dump_rec/) {
111                  my $n = $self->{module} . '::' . $subclass;                  my $n = $self->{module} . '::' . $subclass;
112                  if (! defined &{ $n }) {                  if (! defined &{ $n }) {
113                          my $missing = "missing $subclass in $self->{module}";                          my $missing = "missing $subclass in $self->{module}";
# Line 298  sub open { Line 298  sub open {
298    
299                  $log->debug("position: $pos\n");                  $log->debug("position: $pos\n");
300    
301                  my $rec = $self->{fetch_rec}->($self, $db, $pos, sub {                  my $rec = $self->{fetch_rec}->($self, $pos, sub {
302                                  my ($l,$f_nr) = @_;                                  my ($l,$f_nr) = @_;
303  #                               return unless defined($l);  #                               return unless defined($l);
304  #                               return $l unless ($rec_regex && $f_nr);  #                               return $l unless ($rec_regex && $f_nr);
# Line 348  sub open { Line 348  sub open {
348                  if ($self->{stats}) {                  if ($self->{stats}) {
349    
350                          # fetch clean record with regexpes applied for statistics                          # fetch clean record with regexpes applied for statistics
351                          my $rec = $self->{fetch_rec}->($self, $db, $pos);                          my $rec = $self->{fetch_rec}->($self, $pos);
352    
353                          foreach my $fld (keys %{ $rec }) {                          foreach my $fld (keys %{ $rec }) {
354                                  $self->{_stats}->{fld}->{ $fld }++;                                  $self->{_stats}->{fld}->{ $fld }++;
# Line 546  sub stats { Line 546  sub stats {
546          return $out;          return $out;
547  }  }
548    
549    =head2 dump
550    
551    Display humanly readable dump of record
552    
553    =cut
554    
555    sub dump {
556            my $self = shift;
557    
558            return $self->{dump_rec}->($self, $self->{pos});
559    
560    }
561    
562  =head2 modify_record_regexps  =head2 modify_record_regexps
563    
564  Generate hash with regexpes to be applied using l<filter>.  Generate hash with regexpes to be applied using l<filter>.

Legend:
Removed from v.636  
changed lines
  Added in v.652

  ViewVC Help
Powered by ViewVC 1.1.26