#ex_05-2 #Learning Perl Appendix A, Exercise 5.2 chomp(@words = ); # read the words, minus newlines foreach $word (@words) { $count{$word} = $count{$word} + 1; # or $count{$word}++ } foreach $word (keys %count) { print "$word was seen $count{$word} times\n"; }
This HTML Help has been published using the chm2web software.