On Mon, Sep 26, 2011 at 3:57 PM, Ludwig Isaac Lim <[email protected]> wrote:
> 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.

Not necessarily.  Usually one has to make the filehandle to be written
to as "hot", to borrow mjd's term.  You can do this via setting $|
($OUTPUT_AUTOFLUSH in English) to a nonzero value, or explicitly
setting autoflush via IO::Handle (e.g. autoflush STDOUT 1).

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