yorknong 发表于 2018-8-31 08:41:22

perl学习(一)

  perl 读文件
  open(FILE,"filename.txt");
  my $record;
  while($record=)
  {
  print("file record is : $record\n");
  }
  close(FILE);
  perl 写文件
  覆盖写入
  open(FILE,">filename.txt");
  syswrite(FILE,"This is my write file contents\n");
  close(FILE);
  追加写入
  open(FILE,">>filename.txt");
  syswrite(FILE,"This is my write file \n");
  syswrite(FILE,"This is my write file contents \n");
  close(FILE);

页: [1]
查看完整版本: perl学习(一)