Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-11-29 12:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls