Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have been trying to come up with a nice concise perlish way of building this hash using map, split and pop/shift (etc) rather than the boring old for loop with indices. It seems so simple, but yet my perl is just not cutting it at the moment. Anyone have any cool solutions ? Best Regards, Michaelmy $str1="a,b,c" my $str2="1,2,3" ## output: { a => 1, b => 2, c => 3}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: looking for a perl way to build a hash
by BrowserUk (Patriarch) on Jul 26, 2013 at 13:55 UTC | |
|
Re: looking for a perl way to build a hash
by toolic (Bishop) on Jul 26, 2013 at 13:55 UTC | |
|
Re: looking for a perl way to build a hash
by AnomalousMonk (Archbishop) on Jul 26, 2013 at 13:53 UTC | |
|
Re: looking for a perl way to build a hash
by hdb (Monsignor) on Jul 26, 2013 at 14:06 UTC | |
|
Re: looking for a perl way to build a hash
by choroba (Cardinal) on Jul 26, 2013 at 14:11 UTC | |
|
Re: looking for a perl way to build a hash
by Anonymous Monk on Jul 26, 2013 at 13:53 UTC | |
|
Re: looking for a perl way to build a hash
by code-ninja (Scribe) on Jul 26, 2013 at 19:07 UTC | |
|
Re: looking for a perl way to build a hash
by brx (Pilgrim) on Jul 29, 2013 at 17:50 UTC |