[prev] [index] [next]

Perl Version #1

Comments on this implementation:
  • uses <> and split to break input stream into words
  • the prefixes (space-separated strings) are used as keys for a hash table
  • each hash table data value is a space-separated list of suffix words
  • choose a suffix by split'ing list into array
  • then select a random index value in this array