http://www.perlmonks.org?node_id=127999


in reply to Remove duplicate data from text file

You could use this as well:
use strict; my %hash; my $file = 'infile.txt'; open INFILE, "<$file" || die "Can't open '$file' $!\n" ; $hash{$_}++ while <INFILE>; open OUTFILE, ">$file" || die "Can't open '$file' $!\n" ; print OUTFILE "$_" foreach (keys %hash);

--Jim