eanicom has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl Compatriots,
I'm interested in knowing how to display the data in a hash of hashes using printf. I'm familiar with how to iterate through a typical hash and display the data using printf to format it but I'm having a difficult time displaying the data for a hash of hashes to format it with printf to get it to display how i want it. I know it must be easy but I'm having a bit of a difficult time. Any help would be greatly appreciated
For example,
if the Data is organized as such in the hash of hashes:
James' => { 'detection_profile' => 'disable' }, 'Bob' => { 'detection_profile' => 'enable', 'detection_profile_severity' => '180' }, 'Billy' => { 'detection_profile' => 'enable', 'detection_profile_severity' => '180' }, 'Stephanie' => { 'detection_profile' => 'enable', 'detection_profile_severity' => '180' },
How can I iterate through the hash of hashes to display the data as such:
James disable Bob enable 180 Billy enable 180 Stephanie enable 180
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing hash of a hash data
by davido (Cardinal) on Sep 17, 2012 at 21:32 UTC | |
|
Re: Printing hash of a hash data
by kennethk (Abbot) on Sep 17, 2012 at 21:10 UTC | |
|
Re: Printing hash of a hash data
by 2teez (Vicar) on Sep 17, 2012 at 21:57 UTC | |
by eanicom (Initiate) on Sep 17, 2012 at 22:31 UTC | |
by NetWallah (Canon) on Sep 17, 2012 at 22:46 UTC |