while (<$IN>) { $seen{$_}++ || print $OUT $_ }