in reply to String to tokens

  1. Don't call your sub 'x'. That's the name of a perl operator.
  2. You can use magical split to divide your text on whitespace:
    sub words { split " ", $_[0]; }
    That works by splitting the first argument given to the sub. In a more complex sub, I would have shifted the first argument into a temporary variable.
  3. After Compline,
    Zaxo