in reply to Re^2: Strangely adding a "\n" character prints a variable
in thread Strangely adding a "\n" character prints a variable

The article, Suffering from Buffering was published in The Perl Journal in 1998. If it wasn't a problem in older versions of Perl, why was it so well documented thirteen years ago?

From the article:

When a filehandle is attached to the terminal, as STDOUT is here, it is in line buffered mode by default. A filehandle in line buffered mode has two special properties: It's flushed automatically whenever you print a newline character to it, and it's flushed automatically whenever you read from the terminal.

The implication here is that the line is NOT flushed automatically whenever you DON'T print a newline or read from the terminal.


Dave

  • Comment on Re^3: Strangely adding a "\n" character prints a variable