in reply to What does 'next if $hash{$elem}++;' mean?
Please could somebody put the following line into English.next if $seen{ $elem }++;[snip]
My attempt is:
Insert $elem into the hash 'seen' and skip to the next loop event if this $elem is already present in the hash 'seen'.
How 'bout exectly the way you read it, i.e. "skip to the next iteration of the loop if you have already seen $elem"? That is "if the counter associated to $elem (that is the value of the hash %seen on the key $elem), which you're (post-)incrementing (++) at this iteration too, is greater than zero".
Was there anything particular difficult to understand in this reply?
|
|---|