/[webpac2]/trunk/lib/WebPAC/Input/ISIS.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/ISIS.pm

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

revision 596 by dpavlin, Sun May 14 19:45:36 2006 UTC revision 597 by dpavlin, Thu Jul 13 11:54:33 2006 UTC
# Line 50  sub init { Line 50  sub init {
50    
51  Returns handle to database and size in records  Returns handle to database and size in records
52    
53    my ($db,$size) = $open_db(    my ($db,$size) = $isis->open_db(
54          path => '/path/to/LIBRI'          path => '/path/to/LIBRI'
55            filter => sub {
56                    my ($l,$field_nr) = @_;
57                    # do something with $l which is line of input file
58                    return $l;
59            },
60    }    }
61    
62    Options:
63    
64    =over 4
65    
66    =item path
67    
68    path to CDS/ISIS database
69    
70    =back
71    
72  =cut  =cut
73    
74  sub open_db {  sub open_db {
# Line 77  sub open_db { Line 92  sub open_db {
92                  $isis_db = new Biblio::Isis(                  $isis_db = new Biblio::Isis(
93                          isisdb => $arg->{path},                          isisdb => $arg->{path},
94                          include_deleted => 1,                          include_deleted => 1,
95                          hash_filter => sub {                          hash_filter => $arg->{filter} ? sub { return $arg->{filter}->(@_); } : undef,
                                 my $l = shift || return;  
                                 $l = $self->{iconv}->convert($l) if ($self->{iconv});  
                                 return $l;  
                         },  
96                  ) or $log->logdie("can't find database $arg->{path}");                  ) or $log->logdie("can't find database $arg->{path}");
97    
98                  $db_size = $isis_db->count;                  $db_size = $isis_db->count;
# Line 99  Return record with ID C<$mfn> from datab Line 110  Return record with ID C<$mfn> from datab
110    
111    my $rec = $self->fetch_rec( $db, $mfn );    my $rec = $self->fetch_rec( $db, $mfn );
112    
 }  
   
113  =cut  =cut
114    
115  sub fetch_rec {  sub fetch_rec {

Legend:
Removed from v.596  
changed lines
  Added in v.597

  ViewVC Help
Powered by ViewVC 1.1.26