You may be interested in DBM::Deep
, which can map a memory hash to disk. It can also write files much larger than 4GB, on 64bit systems (see Large File Support
It's also slower than a pure in memory hash, but the on-disk hash is persistent, and may perform better than a disk-swapping context.
(I'm not associated with DBM::Deep, but I used it extensively some years ago, and it saved a lot of time and trouble. So I always try to give back and suggest it where appropriate.)
Quantum Mechanics: The dreams stuff is made of