That's Interesting. Does using grep show any significant improvement over just swapping the order of the foreach loops in your first filter?
I wonder if using each will have any impact? I'll have to give it a go and see.
So maybe something like this?
while (my ($field,$value) = each %{$where}) { @in = grep { $_->{$field} eq $value } @in; }
In reply to Re: On optimizing nested loops
by RichardK
in thread On optimizing nested loops
by FloydATC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |