Hi:

      Thanks for the quick response. Since according to definition of line 
buffering (see below), a buffer is flushed is after newlines, so writing 
statements such as :
        print "<p> This is a paragraph</p>\n"
      

     in a CGI program will automatically flush the buffer right? Or it doesn't? 
I wondering if perl will figure out that since STDOUT is not connected to a 
terminal, it will still buffer it even though the print contains a newline.

    


Regards,
Ludwig




>________________________________
>From: Zak Elep <[email protected]>
>To: Ludwig Isaac Lim <[email protected]>; Philippine Linux Users' Group 
>(PLUG) Technical Discussion List <[email protected]>
>Sent: Monday, September 26, 2011 2:53 PM
>Subject: Re: [plug] Perl and buffering
>
>On Mon, Sep 26, 2011 at 2:44 PM, Ludwig Isaac Lim <[email protected]> wrote:
>> Hi:
>>    From the glossary of the camel book:
>>    line buffering
>>         Used by a standard I/O output stream that flushes its buffer after
>> every newline, many standard I/O libraries automatically set up line
>> buffering on output that is going to the terminal
>>     So this means that to make CGI use buffers, one should avoid newlines in
>> print statement?
>>     Thanks!
>
>I don't get what you mean here (particularly on "make CGI use
>buffers": are you talking about buffered output from CGI?), but mjd
>has a helpful writeup on buffering issues:
>
>http://perl.plover.com/FAQs/Buffering.html
>
>-- 
>Zak B. Elep  ||  zakame.net
>1486 7957 454D E529 E4F1  F75E 5787 B1FD FA53 851D
>
>
>
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to