Think about Loose Coupling | |
PerlMonks |
Counting hash of hashes elementsby albert (Monk) |
on Nov 01, 2004 at 11:15 UTC ( [id://404271]=perlquestion: print w/replies, xml ) | Need Help?? |
albert has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to count keys in a hash of hashes based on their values. I have an example hash snipit as follows:
There are a couple of different ways I'd like to count the keys on this hash. 1. How can I count the number of keys where 'x' has a defined value, but does not have a value for 'y'? 2. How can I count the number of keys which have a defined value for 'z'? Thanks for all shared wisdom. Update: Thanks for showing me how to do this. One additional thing I forgot to ask in my original question. How would I also count the number of keys with a value of 101 for 'z'?
Back to
Seekers of Perl Wisdom
|
|