--- trunk2/all2all.pl 2004/06/13 20:20:29 348 +++ trunk2/all2all.pl 2004/06/13 20:39:44 349 @@ -38,7 +38,7 @@ sub get_sf { my (\$found,\$data,\$f,\$sf,\$i) = @_; - if (\$\$data->{\$f}->[\$i]->{\$sf}) { + if (\$\$data->{\$f} && \$\$data->{\$f}->[\$i]->{\$sf}) { \$\$found++; return \$\$data->{\$f}->[\$i]->{\$sf}; } else { @@ -48,7 +48,7 @@ sub get_nosf { my (\$found,\$data,\$f,\$i) = @_; - if (\$\$data->{\$f}->[\$i]) { + if (\$\$data->{\$f} && \$\$data->{\$f}->[\$i]) { \$\$found++; return \$\$data->{\$f}->[\$i]; } else { @@ -71,11 +71,9 @@ for (my \$mfn = 1; \$mfn <= \$maxmfn; \$mfn++) { my \$row = OpenIsis::read( \$db, \$mfn ); -print Dumper(\$row); foreach my \$k (keys %{\$row}) { if (\$k ne "mfn") { foreach my \$l (@{\$row->{\$k}}) { - next if (! \$l); \$l = \$cp->convert(\$l); # has subfields? my \$val; @@ -88,23 +86,25 @@ \$val = \$l; } - push @{\$data->{\$mfn}->{\$k}}, \$val if (\$val && \$val ne ""); + push @{\$data->{\$mfn}->{\$k}}, \$val; } } } + foreach my \$i (@lookup) { + my \$d = \$data->{\$mfn}; if (\$i->{'eval'}) { - my \$eval = fill_in(\$i->{'eval'},\$data->{\$mfn}); - my \$key = fill_in(\$i->{'key'}, \$data->{\$mfn}); - my \$val = fill_in(\$i->{'val'}, \$data->{\$mfn}); + my \$eval = fill_in(\$i->{'eval'},\$d); + my \$key = fill_in(\$i->{'key'}, \$d); + my \$val = fill_in(\$i->{'val'}, \$d); if (\$key && \$val && eval \$eval) { push @{\$data->{lookup}->{\$key}}, \$val; } } else { - my \$key = fill_in(\$i->{'key'}, \$data->{\$mfn}); - my \$val = fill_in(\$i->{'val'}, \$data->{\$mfn}); + my \$key = fill_in(\$i->{'key'}, \$d); + my \$val = fill_in(\$i->{'val'}, \$d); if (\$key && \$val) { push @{\$data->{lookup}->{\$key}}, \$val; }