加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Perl 初学之文件写入 简单的错误!!切记

发布时间:2020-12-16 00:09:13 所属栏目:大数据 来源:网络整理
导读:#perl 文件的写入 open(OUT,"file1"); print OUT("ccccccccccssssssHere is an output line.n"); 运行之后,居然报错:Undefined subroutine main::OUT called at std.pl line 5. 没有定义子程序!!郁闷,这个文件指针怎么会是没定义子程序呢, 最后发现我

#perl 文件的写入

open(OUT,">file1");
print OUT("ccccccccccssssssHere is an output line.n");

运行之后,居然报错:Undefined subroutine &main::OUT called at std.pl line 5.

没有定义子程序!!郁闷,这个文件指针怎么会是没定义子程序呢,

最后发现我写错了 print OUT ("ccccccccccssssssHere is an output line.n"); OUT 后面要有个空格才可以!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读