The Monthly Hole: Anagrams


Goal

Find all the anagrams in a given input stream and display them in the specified format.

An anagram is a word (or phrase, but we'll stick with words for this contest) formed by rearranging the letters of another word (or phrase). For example, elvis and lives.


Rules


Example

Given the input:

  hack
  snooped
  tables
  salt
  spiff
  feeling
  spooned
  last
  grep
  bleats
  gas
  ablest
  fleeing
  stable
  slat
  drive

You are to output the following:

  feeling fleeing
  snooped spooned
  last salt slat
  ablest bleats stable tables


Deadline

The game starts April 1st (00:00 UTC) and ends April 8th (00:00 UTC).


Test program

A test program is provided to help screen entries.

Any program that passes the test program should be submitted. If you are surprised that your solution passed the test program, please submit it anyway! That will help us identify bugs in the test program.

For the test program to work correctly, you will have to name your script anagrams.pl and place it in the same directory as your test program. Run the test program:

$ perl tpr02.pl

to verify that your entry is valid.

Passing the test program does not assure your solution is valid. The referees have the final say.


Submitting

You can submit your solution here (you'll notice it's the same page as the Leaderboard).

Do not publish your solutions anywhere. That will spoil the game, as your solutions are meant to be secret. All solutions will be published at the end of the game.

Prizes (provided by The Perl Review) will be awarded to veteran and beginner winners. A prize may also be awarded to any especially interesting artistic and/or unorthodox solutions.


Leaderboard

You can track your ranking through the leaderboard here. Beginners are encouraged to enter and there is a separate leaderboard for them.


Feedback

We encourage you to send feedback as well as your ideas for future holes and tiebreakers to golf@theperlreview.com.


Referees

As Perl Golf grows in popularity, the number of solutions submitted threatens to overwhelm the referees. We would like to thank Peter for accepting our invitation to join the ranks of Golf Referees. In order to allow Peter (and maybe even Jérôme and Dave) to play in future golf challenges, we would like to create a ``pool of referees''. For each tournament, the necessary amount of referees would be used. Referees in the pool do not have to referee every month.

If you'd like to be a part-time referee, drop us a note: golf@theperlreview.com