http://qs321.pair.com?node_id=1116060


in reply to How to find the repeated text in hash

Assuming you mean to count the number of occurrences of the same value for different keys in a hash (%names in the example below)
... my %name_count; for my $name (values %names){ $name_count{$name}++; } for my $name (sort {$name_count{$a}<=>$name_count{$b}} keys %name_coun +t){ print "$name occurs $name_count{$name} times in the \%names hash\n"; }
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."