in reply to Keeping hash table in memory

Environment variables are not designed for speed, and you can't set environment vars in a parent process, so forget that idea.

I guess a good idea would be DBM::Deep and hope that your operating system's file cache keeps that in memory. It's quite fast actually, give it a try.

Another idea might be memcached and one of its various perl bindings.