Under UNIX I don't believe it is possible to share
filehandles among processes since the kernel's filehandle
table is linked to the processes PID.
A few other options come to mind:
- Have N query-handling processes with each handling M of the DBM files
(where M < max filehandles per process).
When you want to know if X is in any of the hashes use IPC
to message each of your DBM query handling processes to see
if they have it in any of their files.
- If you are daring try perl's multithreading architecture
with a similar approach to above. Not sure if multithreads
will get around the per-process filehandle limit though.
- Load the DBM files into an SQL DB and work off of it.
May not be a viable option if the DBM files change frequently (if they
do you're already in deep trouble and all the spiffy hardware
in the world won't make this fast).
Personally I would try and find a way to load these files into
a SQL DB or any solution you come up with is likely not to
scale very well.