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?
[davies]: There is an option (I have it set) to force preview before submission. Perhaps your option has been set (accidentally?) and you are not expecting it.
[ambrus]: sorry, I mean at least two words for the title and then preview
[ambrus]: davies: that option is the default. and it's not really "force", it just hides the button.
[marto]: yes, not reading the errors displayed has been a cause of this type of report in the past
[nysus]: Ambrus, ah. I think that was the problem. I'll try. Thanks!
[davies]: Ambrus: you've missed it by a couple of weeks, but consider next year's London Perl Workshop.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2017-12-15 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (431 votes). Check out past polls.

    Notices?