-1
다음 perl 스크립트를 사용하여 각 행에 대한 비교를 찾고 있습니다. 나는 dubes 줄 중 하나를 지우는 방법을 이해하려고 노력 중입니다. (현재 파일이나 출력을 새 파일에 저장합니다). 전체 스크립트 : http://pastebin.com/Vn1V0Uq2 내가 바로 당신을 이해한다면Perl에서 행 삭제하기
while (@lines) {
my ($line, @found) = shift @lines;
my $re = qr/\Q$$line{data}\E$/; # search token
@lines = grep { # extract matches from @lines
not $$_{data} =~ $re && push @found, $_
} @lines;
if (@found) { # write the report
print "line $$_{line}: $$_{data}\n" for $line, @found;
print "\n";
}
}