my $prev; $_ ne $prev and print $prev = $_ while <>;