Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: looking for a perl way to build a hash

by AnomalousMonk (Canon)
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 }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046516]
help
Chatterbox?
Corion looks at TheDamians new modules. It seems he's written another Perl parser in a regexp and uses it for Keyword::Declare ...
[Discipulus]: from txt to array, from array to polemic, from polemic to flame?
[Corion]: Discipulus++ # profound insight
[Corion]: :-D

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2017-06-23 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (536 votes). Check out past polls.