>perl -wMstrict -lne "@::i{ /\w+/g } = () }{ print for keys %::i" words2.txt bar baz qux foo