jojojo has asked for the wisdom of the Perl Monks concerning the following question:
Hello, Im new to PERL and thus stuck with something. I have an array which contains two elements. I want to create a hash such that the first element is the key for the second element. How do I do that? I tried a few things but nothing seems to be working.
my %sizes = map { "$symbolsizes[0]" => "$symbolsizes[1]" } ;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to create hash out of an array elements?
by wfsp (Abbot) on Nov 17, 2011 at 08:49 UTC | |
Re: How to create hash out of an array elements?
by ikegami (Patriarch) on Nov 17, 2011 at 09:07 UTC | |
by jojojo (Initiate) on Nov 17, 2011 at 09:19 UTC | |
by ikegami (Patriarch) on Nov 17, 2011 at 10:02 UTC | |
by aaron_baugher (Curate) on Nov 17, 2011 at 12:24 UTC | |
Re: How to create hash out of an array elements?
by CountZero (Bishop) on Nov 17, 2011 at 10:47 UTC | |
Re: How to create hash out of an array elements?
by ansh batra (Friar) on Nov 17, 2011 at 09:38 UTC |
Back to
Seekers of Perl Wisdom