1019 |
|
|
1020 |
confess "lookup needs 5 arguments: what, database, input, key, having" unless ($#_ == 4); |
confess "lookup needs 5 arguments: what, database, input, key, having" unless ($#_ == 4); |
1021 |
|
|
1022 |
warn "# lookup ($database, $input, $key)\n"; |
warn "## lookup ($database, $input, $key)", $/ if ($debug > 1); |
1023 |
return unless (defined($lookup->{$database}->{$input}->{$key})); |
return unless (defined($lookup->{$database}->{$input}->{$key})); |
1024 |
|
|
1025 |
confess "lookup really need load_ds_coderef added to data_structure\n" unless ($load_ds_coderef); |
confess "lookup really need load_ds_coderef added to data_structure\n" unless ($load_ds_coderef); |
1027 |
my $mfns; |
my $mfns; |
1028 |
my @having = $having->(); |
my @having = $having->(); |
1029 |
|
|
1030 |
warn "## having = ", dump( @having ); |
warn "## having = ", dump( @having ) if ($debug > 2); |
1031 |
|
|
1032 |
foreach my $h ( @having ) { |
foreach my $h ( @having ) { |
1033 |
if (defined($lookup->{$database}->{$input}->{$key}->{$h})) { |
if (defined($lookup->{$database}->{$input}->{$key}->{$h})) { |
1097 |
die "save_into_lookup needs key" unless defined($key); |
die "save_into_lookup needs key" unless defined($key); |
1098 |
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' ); |
1099 |
|
|
1100 |
warn "## save_into_lookup rec = ", dump($rec), " config = ", dump($config),"\n"; |
warn "## save_into_lookup rec = ", dump($rec), " config = ", dump($config), $/ if ($debug > 2); |
1101 |
|
|
1102 |
my $mfn = |
my $mfn = |
1103 |
defined($rec->{'000'}->[0]) ? $rec->{'000'}->[0] : |
defined($rec->{'000'}->[0]) ? $rec->{'000'}->[0] : |