#!/usr/bin/perl -w use strict; my ($userin, $key, $value, %fred) ; print "Type in a list of words. Type done when finished.\n" ; %fred = ("aaa" =>"aaapple", "bbb" => "bbbat") ; while (($key, $value) = each(%fred)) { print "key = $key value = $value\n" ; } delete $fred{"aaapple"} ; print "This is after the deleted aaaple" ; while (($key, $value) = each(%fred)) { print "key = $key value = $value\n" ; } #### 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"; }