for (keys %hash1) { if (exists $hash2{$_} and exists $hash3{$_}) { print $hash1{$_}, $hash2{$_}, $hash3{$_}; } }