chrisbarton has asked for the wisdom of the Perl Monks concerning the following question:
and @requests contains:firstemailaddress@com secondemailaddress@com
But with the code, the emails get sent out, but each one contains the first set of info. The problem seems to be that @requests resets to the start of the array in each foreach $email loop. Is there any way to stop it resetting but rather carrying on from where it left off?first lot of info ------------------------------------------ second lot of info ------------------------------------------
foreach $email (@emails) { open(MAIL,"|$mailprog -t"); print MAIL "To: $email"; print MAIL "From: $myemail\n"; print MAIL "Subject: test\n\n"; LINE: foreach $requests (@requests) { until ($requests =~ "----------------------------------------- +----------------------------") { print MAIL "$requests"; next LINE; } close (MAIL); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach returning to start of array
by Juerd (Abbot) on Apr 02, 2002 at 10:48 UTC | |
|
Re: foreach returning to start of array
by Mask (Pilgrim) on Apr 02, 2002 at 12:12 UTC | |
|
Re: foreach returning to start of array
by mrbbking (Hermit) on Apr 02, 2002 at 13:01 UTC | |
|
Re: foreach returning to start of array
by particle (Vicar) on Apr 02, 2002 at 13:28 UTC | |
|
Re: foreach returning to start of array
by petral (Curate) on Apr 02, 2002 at 14:53 UTC | |
|
Re: foreach returning to start of array
by perlplexer (Hermit) on Apr 02, 2002 at 15:37 UTC | |
|
Re: foreach returning to start of array
by dragonchild (Archbishop) on Apr 02, 2002 at 16:24 UTC |