in reply to unique words

Everything you need is covered in perlintro (a 30 minute read), and perlfaq4#How can I get the unique keys from two hashes, plus a little imagination.

Here's a basic description:

  1. Declare a hash... maybe call it %words.
  2. Set up an input loop: while(my $line = <> ) { ...
  3. Chomp your input.
  4. Use the input as a hash key: $words{$line}++.
  5. After the loop ends, print the keys of the hash.

Dave

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.