read a text or a dictionary find each word and filter out rubbish (numbers, initials, etc) enter the words in a hash keyed on their last N chars - an attempt to rhyme. TeX::Hyphen hyphenates the words so it's better but misses out a lot of words. create a pattern for the sentence, (0,1,0,0,1,0) meaning: pick random word for first word, second word change the ending, (1) so pick up a random word with different ending. 3rd word continue with same ending as previous (0) etc.