Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Can I clean this up??

by djantzen (Priest)
on Jul 24, 2002 at 10:53 UTC ( [id://184765]=note: print w/replies, xml ) Need Help??


in reply to Can I clean this up??

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?.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://184765]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-03-29 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found