http://qs1969.pair.com?node_id=474783

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:
accesslevels' => { 'function' => { 'func1' => { 'content' => 'val1' }, 'default' => { 'content' => 'val2' } } }
What's the easiest (most elegant) way to remove the 'function' and the 'content' so that I get something like:
accesslevels' => { 'func1' => 'val1' 'default' => 'val2' }

Thanks

Hoppfrosch