interoffice memo to learn modular arithmetic to---- >myemail@testmail.com interoffice memo to learn modular arithmetic to---- >email2@testmail.com interoffice memo to learn modular arithmetic to---- >anothe@test.comn interoffice memo to learn modular arithmetic to---- >yaea@sendmail.edu #### #! /usr/bin/perl $_mergeFields="##fname##;##lname##;##email##;##phone##"; $_list_to_send_to= "Richard;Smith;myemail\@testmail.com;8005551212| Toby;Johnson;email2\@testmail.com;8885551212| Chanty;Perkins;another\@test.comn;8665551212| Eli;Codernaught;yaea\@sendmail.edu;8225551212"; %_merData = (); %_mergedData = (); $_field = 0; while($_mergeFields){ $_field++; ($_tempVar,$_mergeFields)= split /\;/, $_mergeFields,2; $_merData{$_field} = $_tempVar; print "FieldsStack=$_field:\n". "pop \t$_tempVar\n". "==Fields stack:$_mergeFields\n"; } $_field = 0; $_recipient_list=0; while($_list_to_send_to) { $_recipient_list++; ($_tempVar,$_list_to_send_to) = split /\|/,$_list_to_send_to, 2; my $_tempMailMessage = $_message; my $_tempSubject = $_subject; print "\nRecipient Stack:\n$_list_to_send_to\n". "pop array:$_tempVar\n"; while($_tempVar) { $_field++; ($_tempVar2,$_tempVar) = split /\;/, $_tempVar, 2; $_mergedData{$_field} = $_tempVar2; print "FieldStack=$_field:\n". "pop \t $_tempVar2\n". "==Fields stack: $_tempVar\n". "-----------------\n"; }} for $key (keys(%_merData)) { $_tempMailMessage =~ s/$_merData{$key}/$_mergedData{$key}/ig; $_tempSubject =~ s/$_merData{$key}/$_mergedData{$key}/ig; $copykey=$key+1; if($_merData{$key} =~ /email##$/) { $coef=$recipx*$copykey; $ultrakey=$coef-1; $__to=$_mergedData{$ultrakey}; print "\n\ninteroffice memo to learn modular arithmetic to---->$__to\n"; }}} #go_send_the_message($__to,$_tempSubject,$_tempMailMessage);} for $recipx(1...$_recipient_list){