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, $!"; #打开文件追加

posted on 2017-03-06 21:59  BioinformaticsMaster  阅读(353)  评论(0编辑  收藏  举报

导航