Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Counting keys with defined or undefined elements in a hash

by sauoq (Abbot)
on Jun 05, 2003 at 19:25 UTC ( [id://263473] : note . print w/replies, xml ) Need Help??


in reply to Re: Counting keys with defined or undefined elements in a hash
in thread Counting keys with defined or undefined elements in a hash

This should be about twice as fast for large hashes...

my $defined = grep defined, values %h; my $notdefined = keys(%h) - $defined; print "defined - $defined\n"; print "not defined - $notdefined\n";

-sauoq
"My two cents aren't worth a dime.";