Perl: the Markov chain saw | |
PerlMonks |
Re: The While Loop is Breaking My Variablesby pg (Canon) |
on Nov 22, 2005 at 03:58 UTC ( [id://510626]=note: print w/replies, xml ) | Need Help?? |
Your output will not be flushed until the program is finished, unless you forced it to be flushed in a way I demoed at the end of this post, or if your output is big enough to trigger the flush. Try the following code and observe, you will see that the output does not come out on the screen after 1 second, and the first batch of print only comes after about 20 seconds. That is the effect of buffering.
With manual input, most likely you don't have enough input to trigger the print out. The flushing can also be triggered by the end of the program, but with a dead loop that's not happening either. Even if there is any output, it will be quickly flushed out of the physical screen by all the error messages, and you are probably still not going to see the output. But with this code you will see something printed every second:
This too:
Or:
In Section
Seekers of Perl Wisdom
|
|