In Perl, you could use a DBM file (or emulation) to bind a hash to a file.