The only difference between the two branches is the message sent, so the thing to do is to move the common code into a subroutine specifially for sending mail. In each branch of the conditional you would call the subroutine, perhaps passing the desired message as a parameter.
Secondly, try using the module Mail::Send, which provides a simple and standard interface to various mail programs, rather than manually calling a mailer via system. You may find this discussion helpful as well: How do I rewrite mail headers using Mail::Send?.
In reply to Re: Can I clean this up??
by djantzen
in thread Can I clean this up??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |