It would help me to know what you are trying to do. The solutions offered thus far -- "sort -u" and using a hash -- both assume that you want to eliminate a line if it has a duplicate anywhere in the file. If all you want to do is eliminate successive repeated lines, something like this might be better:
my $last = $_ = <>;
print;
while (<>)
{
print if ($_ ne $last);
$last = $_;
}