on-internet
← Community

How to I count multiple values in hash into a new hash?

Stack Overflow ·

My current hash: %hash = ( "foo", [ "apple", "orange", "apple", "apple" ], "bob", [ "apple", "orange", ], ); How do I obtain this output? %hash2 = ( apple => 4, orange => 2, );

Comments

Sign in or sign up to comment and upvote.

No comments yet.