audioboxer has asked for the wisdom of the Perl Monks concerning the following question:
Hi Everyone - I am iterating through data to build this below hash. Now using the keys and "cat_parent_id" I need to create a string from this looks like "Category1,Category2,Category3,Category4". I am at a loss and hoping someone can help. Thank you.
$VAR1 = { '986172' => { 'cat_parent_id' => '', 'cat_name' => 'Category1' }, '986178' => { 'cat_parent_id' => '986177', 'cat_name' => 'Category4' }, '986177' => { 'cat_parent_id' => '986176', 'cat_name' => 'Category3' }, '986176' => { 'cat_name' => 'Category2', 'cat_parent_id' => '986172' } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Organizing data from a hash
by jdporter (Paladin) on Dec 01, 2020 at 18:26 UTC | |
|
Re: Organizing data from a hash (updated)
by haukex (Archbishop) on Dec 01, 2020 at 17:13 UTC | |
|
Re: Organizing data from a hash
by tybalt89 (Monsignor) on Dec 01, 2020 at 20:53 UTC | |
|
Re: Organizing data from a hash
by GrandFather (Saint) on Dec 01, 2020 at 20:23 UTC | |
|
Re: Organizing data from a hash
by alexander_lunev (Pilgrim) on Dec 01, 2020 at 21:03 UTC | |
|
Re: Organizing data from a hash
by kcott (Archbishop) on Dec 02, 2020 at 06:22 UTC |