uniq.pl

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;

你可能感兴趣的:(uniq.pl)