Simply put some unique value (or the whole line) as a key for a hash. I'll let you decide what is an appropriate value for this key - it should be easily generated, and unique for each identical record.
when you find a value you want for the first time.
Then, skip that line when you encounter the same key again. Put: