in reply to Re: Best practices for modifying a file in place: q's about opening files, file locking, and using the rename function
in thread Best practices for modifying a file in place: q's about opening files, file locking, and using the rename function

Wow-- thanks very much for the link to the article. That's my situation exactly, with respect to the use of a "flat-file database" for a web app-- I need to go to the toolbox and get the right tool instead of using a file.

I put too much emphasis on the Cookbook's statement that the recipe is the best way for modifying a file in place. Instead of trying to figure out how to add the file locking that the authors recommend to improve the recipe even further, I should have recognized that modifying a file in place is not the right recipe to solve my problem of creating a database that correctly handles updates.

Thanks for not flogging me <g>

  • Comment on Re^2: Best practices for modifying a file in place: q's about opening files, file locking, and using the rename function

Replies are listed 'Best First'.
Re^3: Best practices for modifying a file in place: q's about opening files, file locking, and using the rename function
by jbert (Priest) on Nov 03, 2006 at 17:30 UTC
    Good luck with the SQL.

    And, to keep things perlish...

    You may already know all this, but there are a *lot* of perl approaches to accessing databases. At their base, they all use 'DBI'. That defines the interface and DBD::xxx module provides the back-end which talks to the database.

    There are an abundance of modules to layer on top of these if you choose (DBIx::Class, Class::DBI and others), which can avoid you having to actually use SQL. I'm not sure I'd recommend these if your needs are really simple. But have a play and see what suits you best. There is also plenty of DB-related stuff in the perlmonks [id://Tutorials] section.