perl怎么计算数组中相同数字的个数?while(){ chomp unless(/^M/){ @tmp=split $count{$tmp[0]} ##统计第一列数字个数 } } print $count{1} ##1的个数 你的代码没贴完 不知道到底是哪里。。