免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2472 | 回复: 5
打印 上一主题 下一主题

请帮忙解释下perl内置变量$| [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-13 22:46 |只看该作者 |倒序浏览
搜索引擎好像没法搜到$|这种符号,只知道说是 $| 控制对当前选择的输出文件句柄的缓冲,不知道什么意思,怎么用。
请各位指教下,谢谢

论坛徽章:
0
2 [报告]
发表于 2011-03-14 00:18 |只看该作者
$| 如果非0,则对当前选定的文件执行写或者打印操作后强制清除缓冲区

论坛徽章:
46
15-16赛季CBA联赛之四川
日期:2018-03-27 11:59:132015年亚洲杯之沙特阿拉伯
日期:2015-04-11 17:31:45天蝎座
日期:2015-03-25 16:56:49双鱼座
日期:2015-03-25 16:56:30摩羯座
日期:2015-03-25 16:56:09巳蛇
日期:2015-03-25 16:55:30卯兔
日期:2015-03-25 16:54:29子鼠
日期:2015-03-25 16:53:59申猴
日期:2015-03-25 16:53:29寅虎
日期:2015-03-25 16:52:29羊年新春福章
日期:2015-03-25 16:51:212015亚冠之布里斯班狮吼
日期:2015-07-13 10:44:56
3 [报告]
发表于 2011-03-14 11:35 |只看该作者
搜索引擎好像没法搜到$|这种符号,只知道说是 $| 控制对当前选择的输出文件句柄的缓冲,不知道什么意思,怎 ...
wjlabcwjl 发表于 2011-03-13 22:46



    这些方面 Perl 自己的文档方便多了,没必要 google
http://perldoc.perl.org/perlvar.html

论坛徽章:
0
4 [报告]
发表于 2011-03-15 03:48 |只看该作者
ok,谢谢了

论坛徽章:
0
5 [报告]
发表于 2012-01-13 14:59 |只看该作者
wao

论坛徽章:
145
技术图书徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11狮子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龙
日期:2014-01-08 15:26:12技术图书徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
6 [报告]
发表于 2012-01-13 17:35 |只看该作者
本帖最后由 jason680 于 2012-01-13 17:37 编辑

如果没网可连,可先查...
$ perldoc perlvar
       ...
       HANDLE->autoflush(EXPR)
       $OUTPUT_AUTOFLUSH
       $|      If set to nonzero, forces a flush right away and after every
               write or print on the currently selected output channel.
               Default is 0 (regardless of whether the channel is really
               buffered by the system or not; $| tells you only whether you've
               asked Perl explicitly to flush after each write).  STDOUT will
               typically be line buffered if output is to the terminal and
               block buffered otherwise.  Setting this variable is useful
               primarily when you are outputting to a pipe or socket, such as
               when you are running a Perl program under rsh and want to see
               the output as it's happening.  This has no effect on input
               buffering.  See "getc" in perlfunc for that.  See "select" in
               perldoc on how to select the output channel.  See also
               IO::Handle. (Mnemonic: when you want your pipes to be piping
               hot.)

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP