Perl计数器
2015-06-01 20:20
302 查看
jrhapt01:/home/tomcat/sbin> cat test.out 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 You have new mail in /var/spool/mail/tomcat jrhapt01:/home/tomcat/sbin> wc -l test.out 15 test.out jrhapt01:/home/tomcat/sbin> cat test.pl open( D, "<", "test.out" ) || die "$!\n"; while (<D>) { $num++; print "\$num is $num\n"; } jrhapt01:/home/tomcat/sbin> perl test.pl $num is 1 $num is 2 $num is 3 $num is 4 $num is 5 $num is 6 $num is 7 $num is 8 $num is 9 $num is 10 $num is 11 $num is 12 $num is 13 $num is 14 $num is 15
相关文章推荐
- Java动态绑定机制的内幕解惑
- LaTeX模板
- 仿微信通讯录列表
- Intent跳转并清除历史
- 跟着实例学习ZooKeeper的用法: Barrier
- linux dns 服务器搭建及配置
- CSAPP 深入理解计算机系统 Buflab实验,缓冲区溢出攻击实验(4)
- Fibonacci Numbers(斐波那契数列 前四位 后四位)
- 【Android】仿微信通讯录中的右侧字母表控件
- 黑马程序员——java基础----集合框架知识点总结(一)
- 关于List操作排序工具,collection.sort的原理
- 阅读程序 多重继承
- java web tomcat,myeclipse, mysql
- 我想过不打扰,却发现做不到。
- 集合框架(四)如何使用以及何时使用HashSet、LinkedHashSet或者TreeSet来存储元素
- Jsp初探2015-06-01
- html5语义化标签(二)
- 创建了对嵌入的互操作程序集间接引用,无法嵌入互操作类型
- 启动代码和Bootloader区别
- 使用预处理语句实现数据查询的方法