|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re: Re: print problemby hossman (Prior) |
| on Dec 21, 2001 at 02:32 UTC ( [id://133704]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
The reason you need to set $| is explained in "perldoc perlvar"...
$| If set to nonzero, forces a flush right away and
after every write or print on the currently
selected output channel. Default is 0
...
STDOUT will typically be line buffered if output
is to the terminal and block buffered otherwise.
...
So in your orriginal program, the buffer was just building
up because it never say a line termination. (and when you
switched to "\n" it did).
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||