Using Bloom Filters
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIHYl7qhcICsqtK4xBoO1CDymDkzCEbh86YDvwVhMqpK2mFzp9y8QEla52bEHxTYgURRXLaBMuDk6KcO2Q6m4gR1WHJ3HCeuM1OekWXOMr6Y2NnAcdq-V4-x3oDsGdERU8fM55hYUmFD0/s320/Speaker728x90.jpg)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAod8ab1L8VGpmt4USsO6qyfwxumm9khYD6eezqpwBYIKUPFc6Gy60jsVxhF3Mn9_bbMkiv7hXQwr1HN053BktiFENDrklNhI74oRHRO1NrAFFRSlATwncrpYu-zUCFwmtFbOljRby8EE/s320/160x600_dotsA_g2m_bor_3l.gif)
foreach my $e ( @things ) { $lookup{$e}++ }
sub check {
my ( $key ) = @_;
print "Found $key!" if exists( $lookup{ $key } );
}
As useful as the lookup hash is, it can become unwieldy for very large lists or in cases where the keys themselves are large. When a lookup hash grows too big, the usual recourse is to move it to a database or flat file, perhaps keeping a local cache of the most frequently used keys to improve performance.
Labels: Bloom Filters