while (my ($field,$value) = each %{$where}) { @in = grep { $_->{$field} eq $value } @in; }