word occurrence a 2 b 4 c 2 d 1 e 1 f 2 g 4 h 3 #### Freq.of occurrence freq_count 0 0 1 2 2 3 3 1 4 2 5 0 #### if(exists($count{$word})){ $occurence = $count{$word}; freq_count++; }