in reply to Re: Hash table question
in thread Hash table question

Uh, not quite. You'll be throwing away any false key ("", "0").

You want:

my @common = grep exists $hash2{$_}, keys %hash1; my @unique1 = grep !exists $hash2{$_}, keys %hash1; my @unique2 = grep !exists $hash1{$_}, keys %hash2;
But if you really want all three at once:
my %t; $t{$_} .= "1" for keys %hash1; $t{$_} .= "2" for keys %hash2;
And then each element of %t will be "1" for 1 only, "2" for 2 only, or "12" for both.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.