in reply to Changing the name of STDOUT...

Why are you negotiating with sendmail directly? Just use Mail::Send. This will simplify your code and make it more portable.

Then the solution to your problem is to create a "fake" version of that module which uses the same API and just echos back to the screen rather than sending mail. Change which use you do, and all of a sudden you are sending mail rather than printing.

Failing that I would take tye's advice above.

  • Comment on Re (tilly) 1: Changing the name of STDOUT...