Please excuse my lack of knowledge in this subject.  The original script
executes every statement and in the process, it erases the file when it
does the open and then proceeds to not write to the file at all.  Is the
text that is supposed to be written to the file stored in a buffer while
the program is executing?  I am using the standard Perl mods that came
with SuSE SLES 8.0 (perl 5.8).  Is there an upgrade that I sould apply?
I assure you that this is the problem.  I change the sleep 1; to
system("sleep 1"); and the script runs perfectly.

Nate.

-----Original Message-----
From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 18, 2005 10:36 AM
To: beginners-cgi@perl.org
Subject: Re: No appending...

>>>>> "Nathaniel" == Nathaniel J Wert <[EMAIL PROTECTED]> writes:

Nathaniel> Actually, with the help of another person here we figured out

Nathaniel> what was wrong.  Apparently there is a problem with the
Nathaniel> sleep() function where it interferes with the open() of the 
Nathaniel> file.

That can't be the case.  You have reached a false conclusion.

Nathaniel>   We have found three ways of fixing this.
Nathaniel> system(sleep 1); instead of sleep()

I don't think this would change it at all, unless for some reason Perl
is now flushing all buffers whenever a child process is forked.

Nathaniel>  or using fopen instead
Nathaniel> of open.  I welcome your comments and thanks for the help.

fopen() means you are creating an unbuffered filehandle, just like my
code said to do. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to