in reply to fork() and batch processing mail (was: Quicker array processing)

I just got done writing an application that does exactly what you want to do. I will give you this one bit of advice. Don't use a foreach loop, like:
for my $email (@emails){
    #fork();
}

I suggest this:
while (@emails){
    my $email = shift(@emails);
    #fork();
}

It will reduce memory usage. At least over time. I'm sure there is a better way, but it works for me.

To handle the message array processing. I set up @mime_data, @text_data array's. Then in my send code something like this:
for (@mime_data){
    s/PATTERN/$var/g;
    push(@foo,$_);
}
Net::SMTP->data("To: $email",@foo);
So I obviously use Net::SMTP. That is the only module I use, I suggest you do the same unless you want to bloat your code - or you know more than I do. :)
  • Comment on Re: fork() and batch processing mail (was: Quicker array processing)