hoppfrosch has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I'm looking for a simple way to "flatten" hashes.
For example I have a hash that looks like this:
Thanks
Hoppfrosch
I'm looking for a simple way to "flatten" hashes.
For example I have a hash that looks like this:
What's the easiest (most elegant) way to remove the 'function' and the 'content' so that I get something like:accesslevels' => { 'function' => { 'func1' => { 'content' => 'val1' }, 'default' => { 'content' => 'val2' } } }
accesslevels' => { 'func1' => 'val1' 'default' => 'val2' }
Thanks
Hoppfrosch
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to flatten hashes?
by rev_1318 (Chaplain) on Jul 14, 2005 at 08:09 UTC | |
Re: How to flatten hashes?
by dirac (Beadle) on Jul 14, 2005 at 08:03 UTC | |
Re: How to flatten hashes?
by duelafn (Parson) on Jul 14, 2005 at 12:01 UTC | |
Re: How to flatten hashes?
by tlm (Prior) on Jul 14, 2005 at 13:13 UTC | |
Re: How to flatten hashes?
by EvanCarroll (Chaplain) on Jul 14, 2005 at 20:50 UTC |
Back to
Seekers of Perl Wisdom