Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Having trouble loading a hash with map

by thundergnat (Deacon)
on May 03, 2012 at 14:34 UTC ( #968756=note: print w/replies, xml ) Need Help??

in reply to Having trouble loading a hash with map

It is because you are only applying the map to the first line of the file. Try:

use strict; use Data::Dumper; my %hash; %hash = map {map { chomp; $_ => '1' } split /(\s+|\W+)/} <DATA>; print Dumper(\%hash); __DATA__ LOW-RES PDF NOT PRINT-READY MY BIG TOE BOOK 1: A WAKENING Section 1 Delusion or Knowledge: Is This Guy Nuts, or What? Section 2 Mysticism Demystified The Foundations of Reality LOW-RES PDF NOT PRINT-READY The My Big TOE reality model will help you understand your life, your purpose,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968756]
[erix]: and my solfège is a little rusty too
[stonecolddevin]: damn where's a working cblast? looks like several of them are out of commission
[erix]: Tanktalus home node has one
[stonecolddevin]: erix thanks mate
[stonecolddevin]: also lol @ "I stomped a crap"
[stonecolddevin]: Disciplus i was just amazed he's returned after the thorough stomp that BrowserUk and several other monks gave him for spreading crap info
[stonecolddevin]: i will admit i find the responses to his threads incredibly entertaining

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2017-06-22 20:42 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (529 votes). Check out past polls.