如何在PERL文件中执行PERL命令
时间:2010-10-18
来源:互联网
perl -ne 'print "test\n" if $.==3;print;' 200800117_haha_abc_flow
作者: ztj2247 发布时间: 2010-10-18
作者: 兰花仙子 发布时间: 2010-10-18

作者: zhlong8 发布时间: 2010-10-18
兰花仙子 发表于 2010-10-18 19:40
就是我要在PERL文件中 运行 perl -ne 'print "test\n" if $.==3;print;' $file[0]
Unquoted string "perl" may clash with future reserved word at ./analyse.pl line 57.
Scalar found where operator expected at ./analyse.pl line 57, near "'print "test\n" if $.==3;print;' $file"
(Missing operator before $file?)
syntax error at ./analyse.pl line 57, near "-ne"
Execution of ./analyse.pl aborted due to compilation errors.
作者: ztj2247 发布时间: 2010-10-18
system 或者 反引号``? 你也可以自己在程序里面实现 -n 的效果
作者: zhlong8 发布时间: 2010-10-18
zhlong8 发表于 2010-10-18 20:14
举个例子呀楼上
作者: ztj2247 发布时间: 2010-10-18
http://perldoc.perl.org/functions/system.html
反引号在
http://perldoc.perl.org/perlop.h ... uote-like-Operators
作者: zhlong8 发布时间: 2010-10-18
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28