in reply to output unique lines only
You should try to make a little bit of effort to arrive at a solution on your own, at least say "This is what I've tried but it doesn't work and I don't know why".
Your task can be solved by reading the file in a loop, using split on each line and then putting the first returned element into a hash as a key (for example $hash{$element}=1. After you read the whole file you can open another file for writing and do
for my $name(keys %hash) { print $filehandle "$name\n"; }
Try to solve it with that information and do come back and ask if you have problems.
|
|---|