in reply to Printing hash of a hash data
You can easily get that done like so:
#!/usr/bin/perl use warnings; use strict; my %my_hash = ( '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' }, ); foreach my $detective ( keys %my_hash ) { print $detective; while ( my ( $key, $value ) = each $my_hash{$detective} ) { print " ", $value; } print $/; }
please, you might also like to check perldscStephanie enable 180 James disable Bob enable 180 Billy enable 180
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing hash of a hash data
by eanicom (Initiate) on Sep 17, 2012 at 22:31 UTC | |
by NetWallah (Canon) on Sep 17, 2012 at 22:46 UTC |