You might look at benchmarking the code to see what portions take the longest time.
You might look at possibly using the NET::SMTP or another module for sending mail, and see if it would be feasible to use that module to send the message directly (or queue them up to your outgoing mailserver), rather than opening an external program to send each message-my guess would be that that is probably the most expensive portion of the program. (You might want to look at performing some form of benchmarking to verify this.)
Also, if the same message is being sent to each recipient, you might consider building in memory a template of the message, make a copy then do a search/replace on the portions that are changing. I don't know if that would save much time-you'd need to look at benchmarking the change to be sure.
I'm still learning when to benchmark code as well, but I think this would be an instance where it would prove quite helpful.
I hope some of the more knowledgable monks will be able to provide more helpful information, and that this helps in some small way. Good luck with the project.
In reply to Re: speeding up a script
by atcroft
in thread Speeding up a mailing list script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |