スクリプトがテキスト ファイルの行全体を結果テキスト ファイルに出力するときに問題が発生します。
use strict;
use warnings;
use autodie;
my $out = "result2.txt";
open my $outFile, ">$out" or die $!;
my %permitted = do {
open my $fh, '<', 'f1.txt';
map { /(.+?)\s+\(/, 1 } <$fh>;
};
open my $fh, '<', 'f2.txt';
while (<$fh>) {
my ($phrase) = /(.+?)\s+->/;
if ($permitted{$phrase}) {
print $outFile $fh;
}
close $outFile;
問題はこの行にあります
print $outFile $fh;
何かアイデアはありますか?
ありがとうございました