Re: [問題] 特殊變數 $| 的用途
※ 引述《clanguage (C語言)》之銘言:
: 請問一下 $| 這個特殊變數有什麼用咧?
: 我看書上寫 the autoflush flag determines if line or block buffering
: should be used. if 0, it's block, if 1, it's line.
: 查了網頁上的介紹
: if set to nonzero, forces a flush after every write or print
: When you want your pipes to be piping hot
: 看起來是 flush stream 用的。
: 但是用不用對使用者的影響是甚麼阿?
: 有沒有人瞭解這個東東或是有人有具體的實例之類的?
: 感謝
我自己使用的經驗是
如果設定成0的話 你程式print到screen的東西會累積幾十行才真的print出來
設成1的話 每一行都會real time的print出來
我自己比較習慣設定成1 因為一些debug的information在跑程式的時候
比較看的到
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.248.146
推
08/31 17:18, , 1F
08/31 17:18, 1F
→
08/31 17:18, , 2F
08/31 17:18, 2F
→
09/05 23:32, , 3F
09/05 23:32, 3F
討論串 (同標題文章)
Perl 近期熱門文章
PTT數位生活區 即時熱門文章