Help for this page
>perl -nle "/(\w*)/; $i{$1}++; print qq{$. $_} for keys %i;" words2.txt ... 9 baz 9 qux 9 foo
>perl -wMstrict -lne "/(\w+)/; $::i{$1}++; ... baz 2 qux 2 foo 3