in reply to Perl using $seen with regex
print if /...(...).../ && $seen{$1}++;
(The pattern you had made no sense.)
The above prints the duplicates. Don't forget to negate if you are trying to remove duplicates.
print if /...(...).../ && !$seen{$1}++;
|
|---|