Hi,
I am going to have one perl script, always running, printing new data to the same .txt file that is hosted inside an Apache site.
The .txt page is going to get hit a lot, and quickly. Hella quickly.
I'm concerned that either my users will get a file not found, or that the perl script won't be able to write the file because there are so many users requesting it.
I think I only need Flock when multiple perl script instances are trying to write to the same file.
Do I need to do anything special to my Perl script to tell it, even if the file is busy getting hosted, WRITE the file? My current file writing code is below. I'm writing about 25K at a time.
thanks
Tim
#Is this efficient enough, or do I need something else?
sub align{
open (DEST, ">$file2") || die print "Can't open for Write";
print DEST @buffer;
close DEST;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.