Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: looking for a perl way to build a hash

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


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

List::MoreUtils
use warnings; use strict; use List::MoreUtils qw(mesh); my $str1="a,b,c"; my $str2="1,2,3"; my @a1 = split /,/, $str1; my @a2 = split /,/, $str2; my %hash = mesh(@a1, @a2); use Data::Dumper; $Data::Dumper::Sortkeys=1; print Dumper(\%hash); __END__ $VAR1 = { '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://1046519]
help
Chatterbox?
[robby_dobby]: Or India
LanX which means I can finally organize YAPC Asia in Sharm el Sheikh ;-)
[robby_dobby]: I attended a couple conferences (both in India). Left me with a renewed enthusiasm to do more, only to see it disappear in a few days!
[LanX]: Then come to YAPC EU in Amsterdam ...
[robby_dobby]: LanX: But that's in Africa! More like YAPC::Africa
choroba fears Amsterdam might fill him with enthusiasm to do nothing
[robby_dobby]: Uff, too expensive :-(
[LanX]: ... I found YAPC EU more entertaining (and international )than YAPC NA
[robby_dobby]: What's the site for YAPC::EU?
[LanX]: Robby Dobby no IIRC Sinai is already part of Asia

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2017-04-24 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.