in reply to fast lookups in files

Well, this looks like a perfect job for GDBM_File: it ties a hash to a GDBM file. So you load the hash into the file, and then you can use it just as a regular hash, except it's on disk. That's probably the solution that will involve the less extra coding on your part.