It might not be what you're specifically studying, but you could look into the persistant database stuff. Tie a hash to the file and the rest is magic--delete the entry from the hash and its persistant representation goes away, too. I don't know off hand if there is anything for tying an array to a file, but you could always assign "record numbers" as the hash key.