in reply to Perl overwriting some lines
If the input file happens to contain any duplicate lines, every non-initial occurrence of a duplicated string will be missing from the output.while (my $line = <MIC>){ chomp $line; next if exists $preused{$line}; $preused{$line} = 1; ...
Things are added to the "%preused" hash at another point within that loop as well (although I don't really understand how that other part is supposed to work).
You should be looking at the input file to figure out: (a) how many duplicate lines there are, and (b) how many lines might get eliminated due to the conditions that cause other things to be added to %preused.
|
|---|