I am working on a little script that will check the value of field X and increment the value of field Y by 1 based on the number of times the value of X has come up. My first though was to simply create and array and push unique X values to it and Set Y to 1 when that happens...if it were not unique and equaled a value already in the array I would add 1 to Y. Simple enough....if only all instances of X were in consecutive, which they are not.
My question is how to accomplish this? I just can't seem to wrap my brain around it (even though it seems trivial). I am still very new to perl and sometimes the obvious just is not obvious to me =P