%hash = map {$_ => 1} <>; open OUT, '> file3' or die $!; print OUT for (sort keys %hash);