Why doesn't print output anything on each iteration of a loop when I use sleep?

后端 未结 3 1277
一个人的身影
一个人的身影 2020-12-03 14:46

Today in my college a teacher asked me a question. He wrote this code on the paper and said \"What will be the output of this code?\"

use warnings;

for (1          


        
3条回答
  •  醉梦人生
    2020-12-03 14:47

    Perl, and many other programs, line-buffer output by default. You can set $| to 1 if you need unbuffered output.

提交回复
热议问题