Help for this page
my $chk = sub { (1 == grep defined, @_) or ($_[0] ne $_[1]) }; grep $chk->(values @{$h->{$_}}['O','C']), keys %$h;