Tony23 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, i'm looking to manipulate an hash array and transform/insert it into a new hash, I am a bit unsure how to do this if anyone could help would appreciate it a lot
My Current hash array:
"1" => { "PRICE" => 0, "CODE" => "code value 1", "LABEL" => "RED", }, "2" => { "PRICE" => 0, "CODE" => "code value 2", "LABEL" => "RED", }, , "3" => { "PRICE" => 1, "CODE" => "code value 3", "LABEL" => "BLUE", },
What I want to the hash array to be changed/transformed to:
"RED" => { "PRICE" => 0, "CODE" => "code value 1", "LABEL" => "RED", }, { "PRICE" => 0, "CODE" => "code value 2", "LABEL" => "RED", }, "BLUE" => { "PRICE" => 1, "CODE" => "code value 3", "LABEL" => "BLUE", },
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: hash array question
by choroba (Cardinal) on Nov 08, 2019 at 16:56 UTC | |
by Tony23 (Initiate) on Nov 11, 2019 at 12:27 UTC | |
by AnomalousMonk (Archbishop) on Nov 11, 2019 at 22:21 UTC | |
by choroba (Cardinal) on Nov 11, 2019 at 16:28 UTC | |
Re: hash array question
by Eily (Monsignor) on Nov 08, 2019 at 16:53 UTC | |
Re: hash array question
by AnomalousMonk (Archbishop) on Nov 08, 2019 at 22:01 UTC |
Back to
Seekers of Perl Wisdom