#!/usr/local/bin/ruby while l=gets l.chomp! for word in l.split(/[., \t\n]+/) if word != "" then puts word end end end