in reply to Re^2: What does 'next if $hash{$elem}++;' mean?
in thread What does 'next if $hash{$elem}++;' mean?
use List::MoreUtils qw( uniq ); sub Remove_duplicate_lines { my ($processed_file, $out_file) = @_; open (PROCESSED_FILE, "<$processed_file"); chomp( my @array = <PROCESSED_FILE> ); close PROCESSED_FILE; my @unique = uniq @array; open (OUTFILE, "+>$out_file"); print OUTFILE join( '', @array ); close OUTFILE; }
|
|---|