Нужно удалить дубликаты! Пример список мыл из .txt: [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] Подскажите чем удалить дубликаты?
Code: #!/usr/bin/perl -w use strict; my $origfile = shift; my $outfile = "no_dupes_" . $origfile; my %hTmp; open (IN, "<$origfile") or die "Couldn't open input file: $!"; open (OUT, ">$outfile") or die "Couldn't open output file: $!"; while (my $sLine = <IN>) { next if $sLine =~ m/^\s*$/; #remove empty lines. Without this, still destroys empty lines except for the first one. $sLine=~s/^\s+//; #strip leading/trailing whitespace $sLine=~s/\s+$//; print OUT qq{$sLine\n} unless ($hTmp{$sLine}++); } close OUT; close IN; для дубликата