读文件
open ( my $fh,"
<
","xx.xx")
or die "Can't open file xx.xx :
$!";
while ( < $fh> ) {
chomp;
print;
}
写文件
open ( my $fh,"
>>","xx.xx")
or dir "Can't create file: $!";
判断文件是否存在
if ( -e "xx.xx") {
存在
}else{
不存在
}
close ( $fh);