--- trunk/lib/WebPAC/Input/ISIS.pm 2006/05/14 19:45:36 497 +++ trunk/lib/WebPAC/Input/ISIS.pm 2006/07/13 11:54:33 597 @@ -50,10 +50,25 @@ Returns handle to database and size in records - my ($db,$size) = $open_db( + my ($db,$size) = $isis->open_db( path => '/path/to/LIBRI' + filter => sub { + my ($l,$field_nr) = @_; + # do something with $l which is line of input file + return $l; + }, } +Options: + +=over 4 + +=item path + +path to CDS/ISIS database + +=back + =cut sub open_db { @@ -77,11 +92,7 @@ $isis_db = new Biblio::Isis( isisdb => $arg->{path}, include_deleted => 1, - hash_filter => sub { - my $l = shift || return; - $l = $self->{iconv}->convert($l) if ($self->{iconv}); - return $l; - }, + hash_filter => $arg->{filter} ? sub { return $arg->{filter}->(@_); } : undef, ) or $log->logdie("can't find database $arg->{path}"); $db_size = $isis_db->count; @@ -99,8 +110,6 @@ my $rec = $self->fetch_rec( $db, $mfn ); -} - =cut sub fetch_rec {