Help for this page
foo foo ... bar baz ...
perl -nle '/(\w*)/; print if (not exists $i{$1}); $i{$1}++;' words.txt
perl -nle '/(\w*)/;$i{$1}++; END{print for keys %i;} ' words.txt