Hi there
I have a hash of hashes made up of the following data
bge0|100|half|10.36.100.21
bge1|1000|full|10.36.100.22
bge2|1000|full|10.36.100.23
which when i turn into a hash, would look like this inside the system
bge0 ->
nic_speed -> 100
nic_duplex -> half
nic_ip -> 10.36.100.21
bge1 ->
nic_speed -> 1000
nic_duplex -> full
nic_ip -> 10.36.100.22
bge2 ->
nic_speed -> 1000
nic_duplex -> full
nic_ip -> 10.36.100.23
but there doesnt seem to be an obvious way of using the print command to just print this all to the screen so i can see whats going on inside the hash. i just have to trust its worked...I found this snippet of code which seems to work on a single hash, but not on a "hash of hashes" like mine ...
while ( ($key,$value) = each %hServerData ) {
print "$key => $value\n";
}
I get the following when I run it
$ ./tester.pl
bge0 => HASH(0x88dafc8)
bge1 => HASH(0x88daf28)
bge2=> HASH(0x88db018)
so its printing the value of the hash and finding that its another hash, hence the "HASH(0x88db018)" stuff
Does anybody know how i would be able to adjust the above snippet of code so that it printed something similar to the layout defined above with the top level hash AND the key value pairs of the sub hash?
any help on this would be greatly appreciated