in reply to (Golf) Warningless Comparison

Untested cause I'm in a hurry. Oneliner: grep sub { (1 == grep defined, @_) or ($_[0] ne $_[1]) }->(values @{$h->{$_}}['O','C']), keys %$h; More readable:
my $chk = sub { (1 == grep defined, @_) or ($_[0] ne $_[1]) }; grep $chk->(values @{$h->{$_}}['O','C']), keys %$h;
Not sure how much shorter it is, if at all, didn't have time to count. (Oh my, stress.)

Makeshifts last the longest.