Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Having trouble loading a hash with map

by moritz (Cardinal)
on May 03, 2012 at 14:33 UTC ( [id://968754]=note: print w/replies, xml ) Need Help??


in reply to Having trouble loading a hash with map

The output from Data::Dumper becomes much more readable if you feed it with a reference to a hash:
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://968754]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found