in reply to Removing repeated lines from file

You only have to remember the last unique-line, a shot from the hip (untested!):

open(FILE, "<", name.ext") or die("couldn't open file: $!"); open(OUT, ">", new.ext") or die("couldn't open file for writing: $!") +; my $cmp = <FILE>; # the first line print OUT $cmp; # is always unique while(<FILE>) { if ($_ ne $cmp) { # current line unlike last one? print OUT $_; # print it out $cmp = $_; # current line new reference } # otherwise ignore }

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.