P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm trying to improve my perl-fu a bit, and I think this is a case where I could map or grep. However, it's not working the way I think it should, and I could use a nudge... Now, a FAQ is How do I find out if a hash is empty?. That's not exactly what I want to do. I have a hash, I know there are keys out there, but I want to get a quick count of how many of those keys have non-empty values. Here's a mini-case that I think should work (but doesn't):
I think that the matching operator is having its results stored in @rtn. Then, when I get use that return in scalar context, the result isn't quite what I was looking for. Now I have to figure out how many non-empties are in my array instead of my hash, which is pretty much where I started. Thank you Monasterians... In reply to Count non-empty hash values by pboin
|
|