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
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!