in reply to == uniq

Have you considered a hash?
while(<<fp>>)
{
$myhash{$_}=1;
}
foreach $k(sort keys myhash)
{
print $k;
}

DesertCoder