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

Perl讀寫文件簡單示例

 更新時間:2015年04月14日 09:28:12   投稿:junjie  
這篇文章主要介紹了Perl讀寫文件簡單示例,本文直接給出實現(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";#向文件寫入內容
 print FH "OK\n";
 
 close(FH);
 
 #open a file
 open(FH, "aa.txt") or die $!;
 my @f = <FH>;#將文件內容讀出
 print @f;
 
 close(FH);

相關文章

最新評論