Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I was trying to write a simple while loop:
perl -e 'while(1){sleep 1; print 123;}' # prints nothing perl -e 'while(1){sleep 1; print 123 . "\n";}' # this works perl -e 'while(1){sleep 1; print "123\n";}' # this works also perl -e 'for($i=0; $i < 10; $i++){sleep 1; print $i;}' # this works but prints nothing within 10 seconds. I seems that perl does not flush a printed string without seeing a NL character, is that the right interpretation of this peculiar behavior?Can this be considered as a bug then? In reply to The delay of printing encountered using loop by Diamondust
|
|