deadlock Message Board
[ November Full List | Reply ]

Re: Programming question Part II
From Jim on 16 November '98
replying to Re: Programming question Part II posted by Max

>>~~~~~~~~~~~~
>>
>>(PARSE FORM ETC.)
>>
>>@lollipops = ("email1","email2","email3");
>>@candy = ("email1","email2","email3");
>>@popcorn = ("email1","email2","email3");
>>
>>
>>if ($FORM{'Lollipops'} eq "Yes") {
>> foreach $lolli_email (@lollipops) {
>> open (MAILOLLI,"|/usr/lib/sendmail -t");
>> print MAILOLLI "To: $lolli_email\n";
>> &rest_of_lolli;
>> close (MAILOLLI);
>> }
>
>
>Doing it in the script is OK, but every time the addresses change, you have to edit
>the script. How do you read in a text file of email addresses to send to?
>
>File would have:
>email1
>email2
>email3
>...
>emailn

The first of many logical next steps:

open (LOLLIFILE, "/path/to/lollifile");
@lollipops = <LOLLIFILE>;
close (LOLLIFILE);




Replies from other people:


Reply to this message

Required Details
Your name:
Subject:

Optional Details
Home page title:
Home page URL:
Email:
(if you'd like to receive
automatic replies by email)

Your Message