Hello Gentlemen,

I have seen this done before, but I cannot seem to grasp the 
structure of how it works. Hopefully, someone would not mind 
explaining it to me.

Anyhow, I am trying to open a static file with names and email 
addresses in it and to make sure there are no duplicate email 
addresses before adding the email address to the list.

Could someone explain to me in kindergarten terms how and why 
I do each step to make this happen?

Thanks in advance.


Bill Platt


P.S. Below is the code that I have written to accomplish this, 
and while it seems to work just fine, something in the back 
of my mind tells me that this code will produce some buggy 
behavior with its use.

##########################################################

if ($Entry eq "subscribed")  {


open (Out4a, "$subscribers_file") or print "Failure:
$subscribers_file";
 while (<Out4a>) {
        if ($_ =~ m/$send_email/)  {
                $email_match = "yes";
                                }
 }

close(Out4a);


if ($email_match ne "yes")  {
open (OUT4b, ">>$subscribers_file") or print "Failure:
$subscribers_file";
        print OUT4b "$send_name,$send_email\n";         
close(OUT4b); 
$email_match = "no";
                }
else {
$email_match = "no";
     }

###### more code

}


######## End Snippet ###########
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to