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

perl 读写文件

发布时间:2020-12-16 00:43:04 所属栏目:大数据 来源:网络整理
导读:perl 读文件 open(FILE,"filename.txt"); my $record; while($record=FILE) { print("file record is : $record/n"); } close(FILE); perl 写文件 覆盖写入 open(FILE,"filename.txt"); syswrite(FILE,"This is my write file contents/n"); close(FILE); 追

perl 读文件

open(FILE,"filename.txt");

my $record;

while($record=<FILE>)

{

print("file record is : $record/n");

}

close(FILE);

perl 写文件

覆盖写入

open(FILE,">filename.txt");

syswrite(FILE,"This is my write file contents/n");

close(FILE);

追加写入

open(FILE,">>filename.txt");

syswrite(FILE,"This is my write file /n");

syswrite(FILE,"This is my write file contents /n");

close(FILE);

原文出处(点击此处)

(编辑:李大同)

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

    推荐文章
      热点阅读