$ perl -E 'say for split /\W+/, " THIS is a variable number of words, spaces and punctuation. "' THIS is a variable number of words spaces and punctuation