From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] 

> >>>>> "Wert," == Wert, Nathaniel J <[EMAIL PROTECTED]> writes:
> 
> Wert,> Please excuse my lack of knowledge in this subject.  
> The original script
> Wert,> executes every statement and in the process, it erases 
> the file when it
> Wert,> does the open and then proceeds to not write to the 
> file at all.  Is the
> Wert,> text that is supposed to be written to the file stored 
> in a buffer while
> Wert,> the program is executing?  I am using the standard 
> Perl mods that came
> Wert,> with SuSE SLES 8.0 (perl 5.8).  Is there an upgrade 
> that I sould apply?
> Wert,> I assure you that this is the problem.  I change the 
> sleep 1; to
> Wert,> system("sleep 1"); and the script runs perfectly.
> 
> Then the system() is also forcing a flush of all filehandles.  You can
> avoid the external process using the method I gave earlier.  It's
> not the "sleep".  It's the lack of unbuffering.

This is what I found in perl561delta. 

[...]

Automatic flushing of output buffers

fork(), exec(), system(), qx//, and pipe open()s now flush buffers of all
files opened for output when the operation was attempted. This mostly
eliminates confusing buffering mishaps suffered by users unaware of how Perl
internally handles I/O.

This is not supported on some platforms like Solaris where a suitably
correct implementation of fflush(NULL) isn't available.

[...]

--Ankur 

William "D-FENS" Foster:  I'm the bad guy???  How did that happen?



-- 
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