#!/usr/bin/perl
use strict;
use warnings;
{
$_ = <DATA>;
my $next_line;
while( $next_line = <DATA> )
{
#print "current line: $_ -- next line: $next_line$/";
print $_ if $_ ne $next_line;
}
continue
{
$_ = $next_line;
}
print $_ if eof;
}
__DATA__
apple
apple
plum
vinegar
apple
banana
banana
banana
apple