Wassercrats has asked for the wisdom of the Perl Monks concerning the following question:

I'm having a problem with a cgi script and I think it's due to a log not being updated soon enough after it's written to. My script writes to a log, then loads my homepage, and within a matter of seconds, a SSI needs what was just written to the log. Do I need to perform some kind of check after updating the log that will delay the loading of my homepage? What's the best way to do it?

Replies are listed 'Best First'.
Re: File update test
by Masem (Monsignor) on Mar 20, 2002 at 04:25 UTC
    You need to flush the output handle before you try to read the data. See this page on Perl and Buffering by Dominus for more information.

    -----------------------------------------------------
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
    "I can see my house from here!"
    It's not what you know, but knowing how to find it if you don't know that's important

      Wow, I just read that for a problem two days ago and I didn't think about it even though it's even more relevant to my current problem. I hope it will actually work for this one. Thanks.