…you should look at DB_File or, on newer installs, BerkeleyDB. It turns out (I had some vague recollection of this, and it turned out to be important for my wanna-be-a-hero project) that you can use Berkeley DB to access a text file as if it were a perl array.
This is pretty cool. And fairly efficient, too.