in reply to editing/deleting record in flat file database

Another approach would be to create a Perl data structure out of the file -- just once -- and then serializing it to disk with something like Data::Dumper or Storable.

Updating it would be as simple as manipulating a normal array or hash. You'd have to add serialize/unserialize steps at the start and end of your program, but that's easy to do.

As the number of records increase, so will the memory usage. Of course, the hassle of updating a flat file increases with the current technique, so at some point you might consider a true database. (Somewhere after 100 or 150 records is my personal guideline.)

  • Comment on RE: editing/deleting record in flat file database