with a bunch of spaces. You are splitting on / /, which is a single space, which means you are going to get a lot of empty elements in your resulting list. You probably want to change your split statement to split on /\s+/, which will catch all whitespace between elements.
It seems to me that you want to create an array containing
the words of the file. If you split on space like you have done
split / /, $item, then you will only split on one space.
I think you want to split on: