in reply to need more efficient way to write this query script

I'd suggest using a *DBM of some kind as a tied hash for your DB; once you've built it, you get almost free lookups for your values, which would save you your inner loop.

You'd have to encode multiple values for each key, but you could do that by comma separating them and then doing a split on the value the DB returns. It'd still be MUCH faster than looping over a flat file.

Check out the documentation for AnyDBM_File; it's a bit odd to use tied hashes at first, but you get used to it.
--
Mike

  • Comment on Re: need more efficient way to write this query script