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; }

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?