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.";
In reply to Re: Re: Counting keys with defined or undefined elements in a hash
by sauoq
in thread Counting keys with defined or undefined elements in a hash
by Bukowski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |