in reply to stuck at "Use of uninitialized value in length at ..."

Change while to for because for sets $_, but while does not.

Update: You can verify that by adding print "$_\n"; inside your while loop. See also Basic debugging checklist.

You'll also want to chmop @all_words;

Update: Here is a relevant doc link: Foreach Loops

If VAR is omitted, $_ is set to each value.