perl的特殊變數$| 又可稱 $AUTOFLUSH
預設為0,可設成 $|= 1

利用以下程式碼便可以看出差別,

print "test1\ntest2";
sleep 2;
print "test3\n";

$|= 1
會印出
test1
test2
停兩秒
test3

沒有設$|= 1
會印出
test1
停兩秒
test2
test3

arrow
arrow
    全站熱搜

    kileleu 發表在 痞客邦 留言(0) 人氣()