knoppix@Microknoppix:~$ perl -E ' > $str = q{finding related pages on the world wide web the web}; > $hash{ $_ } ++ for split m{\s+}, $str; > printf qq{%-10s - %d\n}, $_, $hash{ $_ } > for sort keys %hash;' finding - 1 on - 1 pages - 1 related - 1 the - 2 web - 2 wide - 1 world - 1 knoppix@Microknoppix:~$