http://www.perlmonks.org?node_id=670643


in reply to Random word generator

It would be much easier to help improve your code if you posted what you have already tried. However, if I understand the problem correctly, I suggest the following:

  • Get a dictionary file and extract all words of length N.
  • Read the list of all N-character words into an array.
  • Select a random element from the array.