Is it a processing-speed issue? If so I wd have thought you could do something by adding to your db structure. Perhaps another table that had one record per zip code, with that record being the IDs of all the distributors in that zip code. Then you've got two v quick lookups rather than one slowish one. I know this isn't a perl solution! But it sounds more like a db problem (I may have misunderstood - stranger things have happened), and there IS more than one way to do it.