Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Find number of unique values in hash

by CountZero (Bishop)
on Jan 19, 2010 at 22:16 UTC ( #818311=note: print w/replies, xml ) Need Help??


in reply to Re: Find number of unique values in hash
in thread Find number of unique values in hash

Improving on your idea:
print scalar grep{$_->{'age'} == 12} values %hoh;

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^3: Find number of unique values in hash
by saberworks (Curate) on Jan 19, 2010 at 22:21 UTC
    I like yours better.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://818311]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2021-04-15 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?