in reply to Having trouble loading a hash with map
print Dumper \%hash;
Also I suspect that you'll like your results better if you simply split /\W+/. All whitespaces are also non-word characters, and by not capturing the splitter you don't get all those whitespace sequences in your hash.
As for your question, split evaluates its second argument in scalar context, so you are only looking at the first line of input.
|
|---|