perl open函数
open(DATA, "<file.txt"); # <只读打开file.txt ,DATA作为句柄
open(DATA, ">file.txt"); # 写入方式
open(DATA, "+<file.txt"); #打开文件不清空它更新
open DATA, "+>file.txt" or die "Couldn't open file file.txt, $!"; #清空该文件
open(DATA,"+>>file.txt") || die "Couldn't open file file.txt, $!"; #打开文件追加
本文来自博客园,作者:BioinformaticsMaster,转载请注明原文链接:https://www.cnblogs.com/koujiaodahan/p/6512224.html
posted on 2017-03-06 21:59 BioinformaticsMaster 阅读(353) 评论(0) 编辑 收藏 举报