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

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

revision 707 by dpavlin, Mon Sep 25 15:26:12 2006 UTC revision 712 by dpavlin, Tue Sep 26 10:23:04 2006 UTC
# Line 962  sub lookup { Line 962  sub lookup {
962    
963  Save value into lookup.  Save value into lookup.
964    
965    save_into_lookup($key,sub {    save_into_lookup($database,$input,$key,sub {
966          # code which produce one or more values          # code which produce one or more values
967    });    });
968    
# Line 971  This function shouldn't be called direct Line 971  This function shouldn't be called direct
971  =cut  =cut
972    
973  sub save_into_lookup {  sub save_into_lookup {
974          my ($k,$coderef) = @_;          my ($database,$input,$key,$coderef) = @_;
975          die "save_into_lookup needs key" unless defined($k);          die "save_into_lookup needs database" unless defined($database);
976            die "save_into_lookup needs input" unless defined($input);
977            die "save_into_lookup needs key" unless defined($key);
978          die "save_into_lookup needs CODE" unless ( defined($coderef) && ref($coderef) eq 'CODE' );          die "save_into_lookup needs CODE" unless ( defined($coderef) && ref($coderef) eq 'CODE' );
979          my $mfn = $rec->{'000'}->[0] || die "mfn not defined or zero";          my $mfn = $rec->{'000'}->[0] || die "mfn not defined or zero";
980          foreach my $v ( $coderef->() ) {          foreach my $v ( $coderef->() ) {
981                  $lookup->{$k}->{$v}->{$mfn}++;                  $lookup->{$database}->{$input}->{$key}->{$v}->{$mfn}++;
982                  warn "# lookup $k $v $mfn saved\n";     # if ($debug > 1);                  warn "# saved lookup $database/$input/$key [$v] $mfn\n"; #if ($debug > 1);
983          }          }
984  }  }
985    

Legend:
Removed from v.707  
changed lines
  Added in v.712

  ViewVC Help
Powered by ViewVC 1.1.26