sub open_file {
my @files = @_;
my @file_text = ();
foreach my $file(@files){
open(my $fh, '<', "./DATA/" . $file) or die "can't open $file: $!";
@file_text = <$fh>;
close($fh);
}
print "@file_text";
}
将 3 个不同.html
文件中的文本连接到一个数组时遇到问题@file_text
到目前为止,脚本仅将文本存储到它循环通过@file_text
的最后一个文件中。.html