in reply to Counting hash of hashes elements

It looks to me like you don't care if the key is defined, what you're interested in is if there's a value. So I'm not bothering with defined or exists here:
$c = 0; for (keys %hash) { $c++ if $hash{$_}{'x'} && !$hash{$_}{'y'}; +} print "$c\n"; $c = 0; for (keys %hash) { $c++ if $hash{$_}{'z'}; } print "$c\n"; $c = 0; for (keys %hash) { $c++ if $hash{$_}{'z'} == 101; } print "$c\ +n";