in reply to Comparing three Hashes
From your example input/output, it appears that you are only interested in whether a particular key occurs in common between the hashes (the value of those keys doesn't matter). Consider:
One property of a hash is that the key is "unique" - it can only occur once in a particular hash.#!/usr/bin/perl -w use strict; my %hash1 = ( A => 1, B => 2, C => 3, D => 4, ); my %hash2 = ( D=>1, E =>2, F => 3, G => 4, H => 5, I => 6, J=>7 ); my %hash3 = ( J=>1, K =>2, L => 3, M => 4, N => 5, O => 6, P=>7, Q =>8, R =>9, S =>10, T => 11, U =>12, D=>13, ); foreach my $key ( keys(%hash1), keys(%hash2), keys(%hash3) ) { print "$key"; } print "\n"; #prints:ADCBHFJDIGESOJTNPKQMDRLU
|
|---|