> Brian Shields wrote:
>
> I am currently writing a perl script for a friend which is adding to, editing, and
>deleting from a flatfile database. This database will be accessed only by another
>perl script, which uses the information to generate a web page (basically listing the
>information on each line of the database inside an HTML table, generating an HTML
>page with multiple tables, each with the information on a given line in the database,
>which is referenced by the date).
>
> My question is this: since the database will be accessed by the general public
>(read only), and by my friend thru a separate script (add/edit/delete records), do I
>need to use 'flock', and if so, could someone give me a generic example?
No HTML please.
To my understanding, the answer would be no if you are willing to live
with a possibly incorrect view of the page from one of the readers
whilst you are modifying it. If you need to make sure that the DB is
properly reflected (not some intermediate result that you could achieve
whilst you are updating the DB), then you should use a shared lock in the
readers and an exclusive lock by the writer. If you aren't worried that
a reader could get partial results, then don't bother. Chances are that
if you can manage to write the DB with a single write operation, your chances
of a reader getting an incorrect page are lessened (but not necessarily
eliminated). Obviously the OS you are running may affect the outcome.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles http://www.todbe.com/
/ ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_ http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web