http://www.perlmonks.org?node_id=502233


in reply to Count non-empty hash values

If you change your map to grep, then your code works correctly.