http://www.perlmonks.org?node_id=377094


in reply to Combining Ultra-Dynamic Files to Avoid Clustering (Ideas?)

The fact that the files are built at the same time! For every integer that is added in the middle of the mega-file (e.g. all of them), the location of every sub-file would have to be changed!

Do the sub-files' positions really need to change, or is it just the way you're envisioning it would have to be? If they don't need to, maybe a DB_RECNO DB_File is what you need. It would be auto-indexing and you could take sizes of individual records easily. You can splice in new pieces as well as push'ing and unshift'ing from the ends. There is some related file tying goodness in Conway's OOP book, ISBN 1884777791, (his genetic array in particular might be interesting for this).