--- trunk/lib/WebPAC/Input.pm 2006/09/07 15:01:45 652 +++ trunk/lib/WebPAC/Input.pm 2006/09/25 15:26:12 707 @@ -16,11 +16,11 @@ =head1 VERSION -Version 0.12 +Version 0.13 =cut -our $VERSION = '0.12'; +our $VERSION = '0.13'; =head1 SYNOPSIS @@ -162,11 +162,10 @@ code_page => 'cp852', limit => 500, offset => 6000, - lookup => $lookup_obj, stats => 1, - lookup_ref => sub { - my ($k,$v) = @_; - # store lookup $k => $v + lookup_coderef => sub { + my $rec = shift; + # store lookups }, modify_records => { 900 => { '^a' => { ' : ' => '^b' } }, @@ -183,8 +182,7 @@ C create optional report about usage of fields and subfields -C is closure to call when adding C<< key => 'value' >> combinations to -lookup. +C is closure to called to save data into lookups C specify mapping from subfields to delimiters or from delimiters to subfields, as well as oprations on fields (if subfield is @@ -209,6 +207,8 @@ $log->logconfess("lookup_coderef must be CODE, not ",ref($arg->{lookup_coderef})) if ($arg->{lookup_coderef} && ref($arg->{lookup_coderef}) ne 'CODE'); + $log->debug( $arg->{lookup_coderef} ? '' : 'not ', "using lookup_coderef"); + $log->logcroak("need path") if (! $arg->{'path'}); my $code_page = $arg->{'code_page'} || 'cp852'; @@ -640,7 +640,7 @@ my $regexpes; - CORE::open(my $fh, $modify_path) || $log->die("can't open modify file $modify_path: $!"); + CORE::open(my $fh, $modify_path) || $log->logdie("can't open modify file $modify_path: $!"); my ($f,$sf);