lomSpace has asked for the wisdom of the Perl Monks concerning the following question:
I want to use map function to turn an array into key value pairs. The odd numbers are the keys and the even numbers are the values.
my @gene = qw(ATAD3B 83858 ATAD3A 55210 SSU72 29101 SLC35E2 9906 GNB1 2782 TMEM52 339456 GABRD 2563); my %gene = map{$_ => 0} @gene;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array to hash key value pairs
by toolic (Bishop) on Feb 11, 2013 at 20:51 UTC | |
by jms53 (Monk) on Feb 12, 2013 at 11:49 UTC | |
by vinoth.ree (Monsignor) on Feb 12, 2013 at 05:19 UTC | |
| |
|
Re: array to hash key value pairs
by punch_card_don (Curate) on Feb 11, 2013 at 21:52 UTC |