You split on spaces using a regular expression. The consequence of this is that the array you get will contain empty (undefined) elements and this will give you headaches in the remainder of the excercise.
The solution is to split on the character space instead. So
split (' ', ...)
In reply to Re: The Code for counting unique words (help?)
by lyklev
in thread Just starting out with Perl
by iridius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |