;#print $line;#wirte a fileopen(FH, ">aa.txt") or die $!; print FH "hel" />

广州明生堂生物科技有限公司


Perl读写文件简单示例

网络编程 Perl读写文件简单示例 06-21
!/usr/bin/perl -w
 use strict;
 
 #print "please input a stringn";
 #my $line = <STDIN>;
 #print $line;
 
 #wirte a file
 open(FH, ">aa.txt") or die $!; 
 print FH "hellon";#向文件写入内容
 print FH "OKn";
 
 close(FH);
 
 #open a file
 open(FH, "aa.txt") or die $!;
 my @f = <FH>;#将文件内容读出
 print @f;
 
 close(FH);

perl读写文件代码实例
#modeoperandcreatetruncate#read#writeyesyes#appendyesCase1:Throwanexceptionifyoucannotopenthefile:usestrict;usewarnings;my$filename='data.txt';open(my$fh,':encoding(UTF-8)',$filename)ordie"Couldnotope

perl中使用signal(信号)实例
使用signal,能让你的程序功能更丰富。要在Linux下列出所有的signal,利用kill-l即可。下面是我机器上的输出(后面还有到64的没列出来):xuyang@xuyang-deskt

python urllib中的编码处理示例
importurllibdata='丽江'printdata丽江data'xe4xb8xbdxe6xb1x9f'urllib.quote(data)'%E4%B8%BD%E6%B1%9F'那我们想转回去呢?urllib.unquote('%E4%B8%BD%E6%B1%9F')'xe4xb8xbdxe6xb1x9f'pri


编辑:广州明生堂生物科技有限公司

标签:丽江,文件,实例,内容,要在