--- branches/biomed/filter/mem_lookup.pm 2004/09/21 16:40:46 457 +++ branches/biomed/filter/mem_lookup.pm 2004/09/21 16:53:44 458 @@ -23,6 +23,9 @@ # indexer, so it's save to leave type="" undefiend # - lookup will (of course) return one or more values +use warnings; +use strict; + sub mem_lookup { my @out; foreach (@_) { @@ -58,7 +61,7 @@ my ($pre,$k,$post) = ($1,$2,$3); if ($main::cache->{mem_lookup}->{$k}) { #print STDERR "## mem_lookup fetch $k == ".join("|",@{$main::cache->{mem_lookup}->{$k}})."\n"; - foreach my $v (@{$main::cache->{mem_lookup}->{$k2}}) { + foreach my $v (@{$main::cache->{mem_lookup}->{$k}}) { push @out,$pre.$v.$post; } } @@ -71,7 +74,7 @@ } #print STDERR "mem_lookup dump: ",Dumper($main::cache->{mem_lookup}),"\n"; #print STDERR "out: ".Dumper(@out)."\n" if (@out); - return @out; + return wantarray ? @out : shift @out; } 1;