Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: looking for a perl way to build a hash

by BrowserUk (Pope)
on Jul 26, 2013 at 13:55 UTC ( #1046518=note: print w/ replies, xml ) Need Help??


in reply to looking for a perl way to build a hash

$str1="a,b,c";; $str2="1,2,3";; @hash{ split ',',$str1 } = split ',', $str2;; pp \%hash;; { a => 1, b => 2, c => 3 }

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: looking for a perl way to build a hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (17)
As of 2014-09-23 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (221 votes), past polls