Email Purge Duplicates

2009-02-23 Thread tod
I have a routine that is intended to purge duplicates from a list of
emails. It's currently not working. I've spent some time trying to
make it work, but to no avail. Below is the code. If you have any
suggestions, they would be appreciated. I remember seeing something
like...
 foreach $email(@emails)@emails2)){
which is probably what I want.
sub purge
{
open (LIST, $list) or error($list  purge email  );
while (my $line = LIST) {
@emails = split(/\r?\n|\r/, $line);
$emails2 =  @emails;
}
close (LIST);

foreach $email(@emails){
if($email ne $email2){
$newemail .=$email\n;
}
}

open (LIST, $list) or error($list  purge email2);
flock(LIST, LOCK_EX);
print LIST $newemail;
 close (LIST);
success($list has been purged of  duplicates);
}


-- 
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/




Re: Email Purge Duplicates

2009-02-23 Thread Gunnar Hjalmarsson

t...@asgweb.net wrote:

I have a routine that is intended to purge duplicates from a list of
emails. It's currently not working.


perldoc -q duplicate

What has this to do with CGI?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/