uniq.pl
时间:2014-12-30 13:41:57
收藏:0
阅读:282
open RH, $ARGV[0];
%dict = ();
while(<RH>){
chomp;
$ln = $_;
if($dict{$ln}){
$dict{$ln} ++;
}else{
$dict{$ln} = 1;
}
}
while(($k,$v) = each %dict){
print $k ."\t" . $v. "\n";
}
close RH;
原文:http://my.oschina.net/xiechaoyong/blog/362203
评论(0)