in reply to unique words

Sorry, but I don't quite understand your (pseudo)code. Could you further explain what you want to do?

In general, getting the unique lines of a file is a common task that you can find answers for easily if you Google it (just one example of many). Assuming you did that, what did you find, and did it work for you or not? If not, what problems did you have? See also How do I post a question effectively?

If you want to learn how to write it yourself, then the best place to start is perlintro. Combine the things you learned from there (especially the section "Files and I/O") with the FAQ How can I get the unique keys from two hashes? and you should have just about everything you need.

P.S. In the short time since you posted this node, you've edited it at least twice; it'd probably be better if you make use of the "preview" function.

Replies are listed 'Best First'.
Re^2: unique words
by Anonymous Monk on Mar 06, 2015 at 04:47 UTC