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

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

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


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

Not to mention that fact that grep constructs a list, that you then throw away after having counted the number of elements.

In the latest versions of perl (as of 5.8.0, IIRC), grep and map won't build a list in void context.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

  • Comment on Re: Re:x2 Counting keys with defined or undefined elements in a hash