Please, take a look at this code. It opens a txt file and email the =
users. But each user always gets two emails. Any clue?



open (DAT,"<$memberinfo/amdata.db");
if ($LOCK_EX){=20
flock(DAT, $LOCK_EX); #Locks the file
}

@database_array =3D <DAT>;
close (DAT);

foreach $line(@database_array) {
@userarray =3D split(/\:/,$line);=20

    open (MAIL, "|$mailprog -t")
                                || print "Can't start mail program";
    print MAIL "To: $userarray[2]\n";
    print MAIL "From: mailto:production\@stack.com.br\n;
    print MAIL "Subject: Here comes the subject\n";
    print MAIL "testing the email\n\n";
    close (MAIL);
}
exit;

Thanks a lot.



---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to
         [EMAIL PROTECTED]


Reply via email to