欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Perl讀寫(xiě)文件簡(jiǎn)單示例

 更新時(shí)間:2015年04月14日 09:28:12   投稿:junjie  
這篇文章主要介紹了Perl讀寫(xiě)文件簡(jiǎn)單示例,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下

!/usr/bin/perl -w
 use strict;
 
 #print "please input a string\n";
 #my $line = <STDIN>;
 #print $line;
 
 #wirte a file
 open(FH, ">aa.txt") or die $!; 
 print FH "hello\n";#向文件寫(xiě)入內(nèi)容
 print FH "OK\n";
 
 close(FH);
 
 #open a file
 open(FH, "aa.txt") or die $!;
 my @f = <FH>;#將文件內(nèi)容讀出
 print @f;
 
 close(FH);

相關(guān)文章

最新評(píng)論