Hi - below similar approach used by yourself... key difference is that it handles the different 'levels' in which data is structured; ie. 'ID' (hash) - 'key1/key2' (hash-of-hash) - 'keyX-valY' (hash-of-hash-of-array).
my %hash=('ID' => {
'key1' => [ "key1_val1", "key1_val2" ],
'key2' => [ "key2_val1", "key2_val2" ]
}
);
foreach my $id (keys %hash ) {
foreach my $keyno ( sort keys %{$hash{$id}} ) {
for (my $keyvalno = 0; $keyvalno <= $#{$hash{$id}{$keyno}}; $k
+eyvalno++) {
print "$id - $keyno - $hash{$id}{$keyno}[$keyvalno]\n";
}
}
}