Hello, Thank you all for your wisdom. I do appreciate the help & tips:

a, just to clarify, all the files were using the same $SEMAPHORE file, so any instance of $tempfile getting written to, $tempfile was locked. I double checked the locks as well, by placing the sleep method KM had discussed. The lock was working when I had checked. (Using the names "$tempfile" and "$file" were actually just examples, in the code the real file names are placed instead.)

I dunno, I've gone over this a bizillion times and double checked everywhere, and it only happens once in a while where the file gets wiped. I really like KM's method because it does make sense, and that's probably the first time flock() actually makes sense to me. I would guess it's better than when I first began using just flock(FILE,2);

I'll keep plunking away at it, and hopefully I'll get something that will work. Also thanks for the tip to debug "rename" I'll add that right away.

AgentM Thank you for letting me know about the module File::CounterFile I went and took a look, it looks interesting enough, but it says under Bugs that it uses the flock(2); method. This was something I was trying to avoid. What are your feeling on that?

Well Thanks again, I do appreciate the help :-)

PS.. Thanks turnstep that search was great!!


In reply to Re: Re: flock() ..I really need a hand .. please :) by Anonymous Monk
in thread flock() ..I really need a hand .. please :) by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.