$s = new Set::Scalar (keys %hash1); $t = new Set::Scalar (keys %hash2); @isect = $s->intersection($t)->members;