码迷,mamicode.com
首页 > 其他好文 > 详细

perl open函数

时间:2017-03-06 22:22:18      阅读:307      评论:0      收藏:0      [点我收藏+]

标签:die   could   txt   更新   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, $!"; #打开文件追加

perl open函数

标签:die   could   txt   更新   open   函数   打开文件   句柄   只读   

原文地址:http://www.cnblogs.com/koujiaodahan/p/6512224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!