Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Count non-empty hash values

by fishbot_v2 (Chaplain)
on Oct 22, 2005 at 17:34 UTC ( #502232=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $non_empty = grep { $a{$_} ne "" } keys %a;
    print "Keys with non-empty values: $non_empty\n";
    
    __END__
    Keys with non-empty values: 2
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://502232]
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?