my $last; while (<>) { next if ($_ eq $last); $last = $_; print; }