[問題] Perl 用來算所有字出現的次數會不會很難寫?

看板Perl作者 (Yes, Taiwan)時間21年前 (2004/04/08 17:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我想試看看用perl做這個問題... 是不是 mix shell script 或用其它寫會比較快? C/C++當然可以做到, 但只用 perl 可以快一點嗎? produce a count of all the different "words" in a text file. Use any definition of word that makes logical sense or makes your job easy. The output might look like this: 17 a 14 the 9 of 9 in 8 com 7 you 7 that 7 mercedsystems 6 to ... For this input file, the word "a" occurred 17 times, "the" 14 times, -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 63.205.69.67
文章代碼(AID): #10THt6Xs (Perl)
文章代碼(AID): #10THt6Xs (Perl)