in reply to Re: putting text into array word by word
in thread putting text into array word by word

No foreach loop required. You can push several values at once: push @all_words, @these_words;