in reply to How to compare inner keys from two Hashes

How about this:
foreach my $keylogt (keys(%hash1)){ foreach my $keyp (keys(%hash2)){ my @allkeys=(keys %{$hash2{$keyp}},keys %{$hash1{$keylogt}}); my %unique; map($unique{$_}++,@allkeys); my @uniquekeys=keys %unique; # now you have a list of ALL keys in both hashes # and you can process each one and determine if # it appears in one, the other, or both.. } }

Replies are listed 'Best First'.
Re: Re: How to compare inner keys from two Hashes
by Anonymous Monk on Mar 30, 2004 at 17:59 UTC
    Thank you Matija for answering me
    I am new on this, and I do not quite understand how/where in your code can I distinguish keys from %hash1 and %hash2, and process them individually?
    Does @uniquesKey contain keys that did not have a match? but from both hashes?
    I am still confused, how will this solve my problem?
    Thanks