Syntactic Confectionery Delight | |
PerlMonks |
Re: Having trouble loading a hash with mapby moritz (Cardinal) |
on May 03, 2012 at 14:33 UTC ( [id://968754]=note: print w/replies, xml ) | Need Help?? |
The output from Data::Dumper becomes much more readable if you feed it with a reference to a 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.
In Section
Seekers of Perl Wisdom
|
|