作者:在刀尖上起舞66_596 | 来源:互联网 | 2022-01-22 20:42
!/usr/bin/perl -w
use strict;
#print "please input a string\n";
#my $line = ;
#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 = ;#将文件内容读出
print @f;
close(FH);