in reply to Sending Mails without configuration
Obviously, we need considerably more information about what you are trying to do, and what programs you are dealing with.
One strategy that works fairly well, when you are trying to “graft” functionality into a legacy program that doesn’t have it, is to use a separate program that is connected to the first by a FIFO queue, or “pipe.” When the first program wants to (say...) send an e-mail to someone, it writes a record to the pipe, containing the relevant information. The second program, which is asleep waiting for records to arrive in that pipe, then wakes-up and processes the message, independently of the first program and asynchronous to it.
It is usually possible to define pipes to have “many writers” (if you like) “many readers.” So, a single e-mailer program might be able to handle the needs of many client programs. The pipe acts as a convenient, flexible buffer between them.
This is a general approach that can be readily implemented in Perl, but that is not specific to Perl.