Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: looking for a perl way to build a hash

by AnomalousMonk (Abbot)
on Jul 26, 2013 at 13:53 UTC ( #1046516=note: print w/ replies, xml ) Need Help??


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

>perl -wMstrict -le "my $str1 = 'a,b,c'; my $str2 = '1,2,3'; ;; my %hash; @hash{ split q{,}, $str1 } = split q{,}, $str2; ;; use Data::Dump; dd \%hash; " { a => 1, b => 2, c => 3 }


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://1046516]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-05 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls