my %seen; my @data = grep { chomp; not $seen{(split /\|/)[0]}++ } ;