in reply to Re^2: Counting unique instances from Array Sort: explanation needed
in thread Counting unique instances from Array Sort

This question deserves a longer and clearer answer than I have time to give, but the first step to understanding this idiomatic piece of code is realizing that the answer to the question
Why would the value of that first key get incremented?
is that incrementation (and post-incrementation at that, which is the other key to figuring out the idiom) happens because it is always explicitly applied to the value of the current key of the  %counts hash; there is nothing whatsoever conditional about the incrementation.
  • Comment on Re^3: Counting unique instances from Array Sort: explanation needed
  • Download Code