kcorj2244 has asked for the wisdom of the Perl Monks concerning the following question:
This is far outside my level of comfort, and I'm facing a very interesting sitaution. Essentially, I'm dealing with a massive hash. I have access to the hash reference, and I want to traverse the hash and take out the names of the other hashes and their keys. I want to ignore values. Using Data::Dumper is unreadable due to size.
Let me show an example. Note that this is all inside the main hash reference
'flags' => { 'example' => 0, 'font_attributes' => { 'size' => -1, 'colors' => '' }, 'Redacted' => 0, 'Redacted' => [], 'font_changes' => { 'size' => -1, 'colors' => -1 }, 'Redacted' => 0, 'Redacted2' => -1, 'Redacted3' => -1, 'Redacted4' => 0 }, 'Domains' => {}, 'removed_results' => [], 'Words' => {}, 'other_results' => {}, 'recipient_list' => [ 'test@test.com' ], 'Clean' => { 'extra' => {} }, 'result' => 'pass', 'Lists' => { 'Body' => { 'RedactedWordList' => { 'words' => { 'word1' => '5', 'word2' => '1', }, 'words_found' => [], 'weight' => 0 } } }
As you can tell, it just keeps going and going and going and going. I want to be able to print everything except the values. So $startingHash with hashes within it, and those hashes having hashes within them. I want to print the name of every "hash name" and every "key" in a readable format. I can't seem to wrap my brain around how I could do that. I'm tasked with documenting everything available within this mega hash, but I don't need the actual value obviously
|
|---|