这个脚本diff.pl用于求两个文件相同的行和不同的行所构成的差集(即A中存在而B中不存在的行,及B中存在而A中不存在的行)。
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use diagnostics;#warning info
my ($fileA,$fileB) = @ARGV;
open A,'<',$fileA or die "Unable to open file:$fileA:$!";
my %ta;
my $i;
while(<A>){
chomp;
$ta{$_} = ++$i;
}
close A;
open B,'<',$fileB or die "Unable to open file:$fileB:$!";
#open COMM_AB, ">$fileA.comm" or die "Unable to create comm file f......
阅读全文