perl统计句子每个单词出现次数
<p>问题:perl统计句子每个单词出现次数<p>答案:↓↓↓<p class="nav-title mt10" style="border-top:1px solid #ccc;padding-top: 10px;">洪荣晶的回答:<div class="content-b">网友采纳 while (my $line = <DATA>) { x09map{$words{$_}++;} $line =~ /(w+)/g } for (keys(%words)) { x09print "$_: $words{$_}n"; } __DATA__ I am a great man. There is also a great river run aside of me. He and me all alike climbing mountains. He says man are creatures of big thinking.
页:
[1]