in reply to Efficiency in maintenance coding...

If someone's going to maintain perl, I expect them to know or learn what operators like '<>' are, and that you can have statement modifiers, and that there's a '$_' variable, and that this is a whole lot more maintainable (fixing your bug, but not spelling out everything quite as much as tilly did above):
# Count words in files or STDIN my %frequency; while (<>) { $frequency{$1}++ while /(\w+)/g; } print "$_: $frequency{$_}\n" for sort keys %frequency;