Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Count non-empty hash values

by swampyankee (Parson)
on Oct 22, 2005 at 17:44 UTC ( [id://502234]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    @values = values(%hash);
    ...
    {
       $count ++ if defined($i);
    }
    
  2. or download this
    @values = values(%hash);
    
    ...
    {
       $count ++ if $i;
    }
    
  3. or download this
    $count = (grep { /^$/ } values(%hash))- scalar(values(%hash);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found