You could also "change your lookup code" by using Eily's advice and making a tied hash that encapsulates that search across a list of hashes. This would be extensible for adding more hashes as well, if your database grows more "tables" in the future. If the code only does lookups, you should only need to implement a FETCH method. Something like: (untested; the tied object is an array of hashrefs)
sub FETCH {
my $self = shift;
my $key = shift;
foreach my $hash (@$self)
{ return $hash->{$key} if exists $hash->{$key} }
return undef;
}