Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Count non-empty hash values

by swampyankee (Parson)
on Oct 22, 2005 at 17:44 UTC ( #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
Node Status?
node history
Node Type: note [id://502234]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-12-04 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (60 votes). Check out past polls.

    Notices?