/[webpac2]/branches/Sack/lib/WebPAC/Input/ISI.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 /branches/Sack/lib/WebPAC/Input/ISI.pm

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

revision 1314 by dpavlin, Wed Sep 23 14:43:13 2009 UTC revision 1315 by dpavlin, Sun Oct 4 12:32:19 2009 UTC
# Line 105  sub new { Line 105  sub new {
105    
106          $self->{fh} = $fh;          $self->{fh} = $fh;
107          $self->{record_offset} = [];          $self->{record_offset} = [];
108            $self->{offset} ||= 0;
109    
110          while( $line = <$fh> ) {          while( $line = <$fh> ) {
111                  chomp($line);                  chomp($line);
# Line 205  Return number of records in database Line 206  Return number of records in database
206    
207  sub size {  sub size {
208          my $self = shift;          my $self = shift;
209          $#{ $self->{record_offset} } - $self->{offset};          my $size = $#{ $self->{record_offset} };
210            return 0 if $size < 0;
211          # no need for +1 since we record end of file as last record          # no need for +1 since we record end of file as last record
212            return $size - $self->{offset};
213  }  }
214    
215    

Legend:
Removed from v.1314  
changed lines
  Added in v.1315

  ViewVC Help
Powered by ViewVC 1.1.26