for my $key ( keys %one_hash ) { next if ( exists( $other_hash{$key} )); # now do something with this $key, which exists only in %one_hash... }