# open the file into FH my %uniq; $uniq{$_} = 1 while (); print join "\n", keys %uniq; # close the file