我的 perl 脚本有问题:
use strict;
use warnings;
use autodie;
my $out = "result2.txt";
open 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 $phrase ;}
}
close outFile;
错误是:
Name "main::outFile" used only once: possible typo at teeest.pl line 14.
请问有什么想法吗?
谢谢你