in reply to Removing duplicate lines from files (was 'Files')

the simplest way is to use uniq (see 'man uniq')

If you really want to do this in Perl or if this is really
your homework *grin* then:
#assuming that your file has only one email address per line my %emails = (); open FH, "<emails.dat" or die "error: $!"; $emails{$_}++ while (<FH>); close FH; open FH, ">new_emails.dat" or die "error: $!"; print FH $_ while ($_ = each(%emails)); close FH;
--perlplexer