If you'll notice, $_ in the hash is inside the foreach loop, meaning that it refers to that individual value for that iteration of the loop, or a single value resulting from the split of "string of distances" making it refer to a single distance.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
Like I said, the foreach splits the input line, so now you do have a list of distances. The body of the foreach (the part between the braces) then uses each of these distances, one at time, as a key in the hash and increments the value at that position. If you know that the first part splits the line into individual distances, and you know what a hash is, and you know what foreach is, then I don't understand what it is you don't understand about that line.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494