in reply to Parsing a hash of hashes using a schema file
This is what I have tried so far:
while (my($tagkey, $tagvalue) = each %{$my_hash_of_hashes}) { if (ref $tagvalue eq 'HASH') { print "TAG:::> $tagkey value $tagvalue\n"; push(@tag_name, "$tagkey"); } foreach my $hash_tag_names (@tag_name) { while (my ($tagkey1, $tagvalue1) = each %{$my_hash_of_ +hashes->{$hash_tag_names}}) { if (ref $tagvalue1 eq 'HASH') { print "TAG:::> $tagkey1 value $tagvalu +e1\n"; } } } }
As I am not allowed to hardcode hash names like @dev, @fred etc I thought the best way would be to be to first parse this hash of hashes and work out what keys were had values that were 'HASH' and then populate an array called @tag_name and then once I have got all the tags (@dev, @fred etc etc...) in this array I could then do a loop on this array and then for each hash then check for more hashes within these and until I get to the level where all the keys are defined as per whats in the schema %definition and then start outputting data to the files ny_loc and nj_loc. I am just stuck as how to proceed further with what I have done so far. Please can you help me as I haven't done anything like this before?
|
|---|