in reply to How to compare inner keys from two Hashes
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 |